tilemill-project / tilemill

TileMill is a modern map design studio
https://tilemill-project.github.io/tilemill/
BSD 3-Clause "New" or "Revised" License
3.12k stars 528 forks source link

"type": "Feature" not recognized in GeoJSON file #701

Closed navimont closed 13 years ago

navimont commented 13 years ago

When trying to load a GeoJSON data file created by myself, I get the following error:

 Error: Could not create datasource. Required parameter 'type' is missing

Turns out that the type parameter is not the first member in the feature description:

 "geometry": {
    "type": "Point", 
    "coordinates": [
      -73.9963838, 
      40.6939512
    ]
  }, 
  "type": "Feature", 
  "properties": {
    "amenity": "post_box"
  }

If I place "type": "Feature" before the "geometry" member it works. In my opinion the order should not matter here (that's why the members are named, isn't it?). Dictionary elements in python have no particular order, therefore it would be difficult for me to adjust this. I'm using python json encoder.

willwhite commented 13 years ago

Hi @navimont, I'm not able to reproduce this problem with any of the GeoJSON files I normally test with. Are you able to provide a sample problematic GeoJSON file?

Thanks, Will

navimont commented 13 years ago

Hi Will,

Please try this one: http://dl.dropbox.com/u/3145999/epoiserver.json

Thanks, Stefan

willwhite commented 13 years ago

I am able to load that geojson file without any problems. What version of TileMill are you using?

navimont commented 13 years ago

Hi, I tested again and I can't reproduce it any more either. I may have used a file without the .json ending before. Sorry about that. I close the issue. Thanks for this great product!