Skip to content

Commit

Permalink
Temporary fix for geoJSON projection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRunfola committed Oct 3, 2023
1 parent be0997e commit 145c5fa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions geoBoundaryBuilder/builderClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand All @@ -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.")
Expand Down

0 comments on commit 145c5fa

Please sign in to comment.