Vector Overlapping Areas: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(won't work with the DBF driver)
No edit summary
Line 4: Line 4:


   v.in.ogr dsn=./shp/ layer=fireHistory output=fireHistory
   v.in.ogr dsn=./shp/ layer=fireHistory output=fireHistory
   v.category input=fireHistory output=tmpFire
   v.category input=fireHistory output=tmpFire type=centroid
   v.db.addtable map=tmpFire table=tmpFire_2 layer=2 columns='num,int'
   v.db.addtable map=tmpFire table=tmpFire_2 layer=2 columns='cat int'
  v.to.db map=tmpFire layer=2 qlayer=1 option=query col=num qcol='count(*)' type=centroid
      
      
   # Export it to a raster layer:
   # Export it to a raster layer:

Revision as of 14:48, 7 July 2008

Q: How can I determine the number of overlapping features per location after import of SHAPE file?

A: You can run this (example) - note that it won't work with the DBF driver but requires SQLite, PostgreSQL, MySQL, or... driver:

  v.in.ogr dsn=./shp/ layer=fireHistory output=fireHistory
  v.category input=fireHistory output=tmpFire type=centroid
  v.db.addtable map=tmpFire table=tmpFire_2 layer=2 columns='cat int'
   
  # Export it to a raster layer:
  v.to.rast input=tmpFire layer=2 output=mf use=attr column=num