Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polygons appear over Africa? #13

Open
michaelnewsome2 opened this issue Aug 10, 2018 · 3 comments
Open

Polygons appear over Africa? #13

michaelnewsome2 opened this issue Aug 10, 2018 · 3 comments

Comments

@michaelnewsome2
Copy link

https://github.com/simzou/nielsen-dma/blob/master/nielsen-mkt-map_simplified.json

Is there a formula to covert them back of North America?

@bauersfeld
Copy link

Any answer on why the coordinates of the geojson coordinates are off? Is there a transformation or projection that can be applied to resolve the issue?

@dsmallespe
Copy link

Any update on the polygon issue with Africa? I'm seeing the same thing.

@AdarshNamala
Copy link

AdarshNamala commented Nov 5, 2021

to convert topoJson to geoJson, the following worked for me:
required functions: https://github.com/sgillies/topojson/blob/master/topojson.py
reference: https://chart-studio.plotly.com/~empet/14397.embed


#Load the topojson file:
with urlopen("https://raw.githubusercontent.com/simzou/nielsen-dma/master/nielsentopo.json") as request:
    topojson = json.load(request)
    
#Get the required values
topfeats  = topojson['objects']['nielsen_dma']['geometries']
scale = topojson['transform']['scale']
translation = topojson['transform']['translate']

#Convert to geojson
geoJSON=dict(type= 'FeatureCollection', 
             features = [])

for tfeature in topfeats:
    geo_feature = dict(id=tfeature['id'], type= "Feature")
    geo_feature['properties'] = tfeature['properties']
    # geometry function from link above (required functions)
    geo_feature['geometry'] = geometry(tfeature, topojson['arcs'], scale, translation)    
    geoJSON['features'].append(geo_feature)  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants