1

I was given a json file that contains information like as below (truncated version but complete in structure)-

{"type": "FeatureCollection", "features": [{"geometry": {"type": "Polygon", "coordinates": [[[3909262.46926247, -1770881.94706788], [3909261.06123541, -1770740.38745684], [3909401.80402645, -1770738.96964834], [3909400.38998219, -1770596.88864125], [3909400.38998219, -1770596.88864125], [3909539.73283601, -1770453.91231545], [3909539.73283601, -1770453.91231545], [3909824.04203656, -1770734.7109451], [3909404.6218828, -1771022.08945481], [3909263.87730952, -1771023.50751348], [3909262.46926247, -1770881.94706788]]]}, "type": "Feature", "properties": {"dtegranted": 1321488000000, "iss_date": "17/11/2011", "objectid": 1, "company": "Terrastone Limited", "lic_no": "ML0002", "layer": "Mining Licence", "exp_date": "17/11/2016", "address": "P.O. BOX 995, LILONGWE", "id": 1, "area_sqkm": 0.169516104612393, "district": "NJULI", "license": "ML0002", "area": "169516.104612393", "minerals": "Rock Aggregate", "contact": "CHILADZULU", "dteexpires": 1479340800000, "type": "Mining Licence", "statusgrp": "Active"}}]}

and said that projection format is UTM36S nothing else. Now I need to convert this data back into WGS84 and create a polygon shapefile.

I am failing to convert into WGS84 and I converted those json files into shapefile using global mapper(used UTM36S during export to shapefile) since arcmap fails but that pops up as below though global mapper was able decode attributes correctly from the json file but messes up with the geometry-

demo

I tried to convert those utm x and y data into WGS84 using python function as mentioned here but it gives me wrong coordinate Please help-

Full version of data is at http://pastebin.com/embed_js/9FfDYxgN.

1

The format is GeoJSON with type Feature Collection

If I use Python with the Fiona module

import fiona
test = fiona.open("your.geojson")
# structure of test (fields)
test.schema
{'geometry': 'Polygon', 'properties': OrderedDict([(u'dtegranted', 'int'), (u'iss_date', 'str'), (u'objectid', 'int'), (u'company', 'str'), (u'lic_no', 'str'), (u'layer', 'str'), (u'exp_date', 'str'), (u'address', 'str'), (u'id', 'int'), (u'area_sqkm', 'float'), (u'district', 'str'), (u'license', 'str'), (u'area', 'str'), (u'minerals', 'str'), (u'contact', 'str'), (u'dteexpires', 'int'), (u'type', 'str'), (u'statusgrp', 'str')])}
print test.bounds
(3718683.62707189, -1927945.60674904, 3986975.04020849, -1086524.71398137)
len(test)
53

Therefore you have a layer with 53 polygons

First polygon

first = test.next()
print first
{'geometry': {'type': 'Polygon', 'coordinates': [[(3909262.46926247, -1770881.94706788), (3909261.06123541, -1770740.38745684), (3909401.80402645, -1770738.96964834), (3909400.38998219, -1770596.88864125), (3909400.38998219, -1770596.88864125), (3909539.73283601, -1770453.91231545), (3909539.73283601, -1770453.91231545), (3909824.04203656, -1770734.7109451), (3909404.6218828, -1771022.08945481), (3909263.87730952, -1771023.50751348), (3909262.46926247, -1770881.94706788)]]}, 'type': 'Feature', 'id': '1', 'properties': OrderedDict([(u'dtegranted', 1321488000000), (u'iss_date', u'17/11/2011'), (u'objectid', 1), (u'company', u'Terrastone Limited'), (u'lic_no', u'ML0002'), (u'layer', u'Mining Licence'), (u'exp_date', u'17/11/2016'), (u'address', u'P.O. BOX 995, LILONGWE'), (u'id', 1), (u'area_sqkm', 0.169516104612393), (u'district', u'NJULI'), (u'license', u'ML0002'), (u'area', u'169516.104612393'), (u'minerals', u'Rock Aggregate'), (u'contact', u'CHILADZULU'), (u'dteexpires', 1479340800000), (u'type', u'Mining Licence'), (u'statusgrp', u'Active')])}
geometry = first['geometry']
print geometry
{'type': 'Polygon', 'coordinates': [[(3909262.46926247, -1770881.94706788), (3909261.06123541, -1770740.38745684), (3909401.80402645, -1770738.96964834), (3909400.38998219, -1770596.88864125), (3909400.38998219, -1770596.88864125), (3909539.73283601, -1770453.91231545), (3909539.73283601, -1770453.91231545), (3909824.04203656, -1770734.7109451), (3909404.6218828, -1771022.08945481), (3909263.87730952, -1771023.50751348), (3909262.46926247, -1770881.94706788)]]}

enter image description here

You can plot all the polygons with Python (Cartesian system)

enter image description here

What about the projection ?

print test.crs
   {'init': u'epsg:4326'}

By definition the projection of a GeoJSON layer without a spefified crs is epsg:4326 (WGS84) and what is clear is that the coordinates of your file are not in WGS84

You can open this GeoJSON file with QGIS, GvSIG, OpenJUMP, ..., without problem using a UTM36S projection (or any cartesian projection), not WGS84

If you try PosFinder Yo (Find My Projection) with 3909262.46926247,-1770738.96964834 for example, there are some other solutions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.