← Back to team overview

dhis2-devs team mailing list archive

GeoJSON minifier

 

The Mapping module uses GeoJSON. When using tools like ogr2ogr or
Geoserver to generate GeoJSON from shapefiles, I have noticed that
sometimes unnecessary zeros are added to the end of coordinates. This
makes files become very large when there are thousands of points.
Therefore, I have written the attached PHP script (basically a regex)
to remove unwanted decimals from a GeoJSON file. It does not round,
just truncate.

Knut

Attachment: file_upload.php
Description: Binary data