Converting shapefiles; calculating area of lots
Posted by mholmes on 16 Oct 2017 in Activity log
I've written three tiny scripts to generate usable data in GML, GeoJSON and KML from the binary ESRI shapefiles created with QGIS, and I've added all those the repo. I've been investigating the simplest way to generate usable area calculations, and it seems to be this:
ogrinfo -dialect SQLite -sql 'SELECT ST_Area(geometry)/10000 FROM Plan47534' Plan47534.shpwhich generates a text output like this:
INFO: Open of `Plan47534.shp' using driver `ESRI Shapefile' successful. Layer name: SELECT Geometry: None Feature Count: 2 Layer SRS WKT: (unknown) ST_Area(geometry)/10000: Real (0.0) OGRFeature(SELECT):0 ST_Area(geometry)/10000 (Real) = 0.597841877829159 OGRFeature(SELECT):1 ST_Area(geometry)/10000 (Real) = 0.7206513230636
This should be parsable with XSLT (for instance), so an ant task to generate all these things, and hook them up with their lot ids (in ogr:UID elements in the GML files), then generate a stack of SQL statements to update the databases, would seem to be straightforward, if JSR wants us to go that way tomorrow.