Tuesday, 8 September 2015

Merge shapefiles using ogr2ogr and retrieve the attributes of both


I have two shapefiles that I want merge (overlay/intersect) having in the destination the attributes of the two sources file.


ogr2ogr file_merged.shp tl_2010_us_uac10_conus_albersUA.shp

ogr2ogr -update -append file_merged.shp tabblock2010_10_pophu.shp -nln file_merged

In this way I obtain the polygons of the two shapes, but I lose the attributes of the tabblock2010_10_pophu.shp.


My final aim is then make an SQL statement where I can retrieve polygon in common in the both shapes.


Any suggestions??




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...