From 145c5fad0d548b27b551d7d0da3be5872f82b42c Mon Sep 17 00:00:00 2001 From: DanRunfola Date: Tue, 3 Oct 2023 09:13:58 -0400 Subject: [PATCH] Temporary fix for geoJSON projection issue --- geoBoundaryBuilder/builderClass.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/geoBoundaryBuilder/builderClass.py b/geoBoundaryBuilder/builderClass.py index 11141c2..7bdad5f 100644 --- a/geoBoundaryBuilder/builderClass.py +++ b/geoBoundaryBuilder/builderClass.py @@ -857,6 +857,11 @@ def constructFiles(self): writeRet.append(subprocess.Popen(write, shell=True).wait()) + #Need to open and define the projection - unsure if this is a bug in mapshaper precluding + #the projection outputs, or if our tests were ill-formed. + tmpGeomJSONproj = gpd.read_file(jsonOUT) + tmpGeomJSONproj.to_file(jsonOUT, driver="GeoJSON", crs="EPSG:4326") + self.logger("INFO","Building shapefiles, geojson, topojson (Simplified).") writeSimplify = ("/usr/local/mapshaper-0.6.7/bin/mapshaper-xl 6gb " + tmpJson + " -simplify dp interval=100 keep-shapes" + @@ -867,6 +872,10 @@ def constructFiles(self): writeRet.append(subprocess.Popen(writeSimplify, shell=True).wait()) + #Need to open and define the projection - unsure if this is a bug in mapshaper precluding + #the projection outputs, or if our tests were ill-formed. + tmpGeomJSONproj_simplified = gpd.read_file(jsonOUT_simp) + tmpGeomJSONproj_simplified.to_file(jsonOUT_simp, driver="GeoJSON", crs="EPSG:4326") #Create the plot for the boundary to be used in display self.logger("INFO","Plotting preview image.")