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

Make it clear in the readme that geojson option doesn't support GeometryCollection #104

Open
Monduiz opened this issue Nov 28, 2016 · 5 comments
Labels

Comments

@Monduiz
Copy link

Monduiz commented Nov 28, 2016

I am trying to calculate the number of buildings in a geometry.

When I run index.js, I get "error: geometry not implemented at Object.getTiles [as tiles]" in module 'tile-cover, index.js:84' .
I checked the GeoJson and it seems valid. It was created in QGIS and I have tested it in mapshaper.

I have tested and tried with different geojsons, all valid. I always get the same error from tile-cover.

The scripts are here.
Data is canada.mbtiles (not uploaded).

@mourner mourner added the bug label Dec 14, 2016
@mourner
Copy link
Member

mourner commented Dec 14, 2016

This happens because tile-cover doesn't support geometry collections. Your script will work if you remove the collection wrapper from Ottawa.json (making it just a MultiPolygon).

We should add a note in the readme stating that geometry collections are an exception in the geojson option.

@mourner mourner removed the bug label Dec 14, 2016
@mourner mourner changed the title Error: geometry type not implemented Make it clear in the readme that geojson option doesn't support GeometryCollection Dec 14, 2016
@Monduiz
Copy link
Author

Monduiz commented Dec 16, 2016

Thanks @mourner. I modified the GeoJson to MultiPolygon with OttawaMP.json and did a test. Now I am getting a Unsupported MBTiles format: undefined error. I checked the geojson and its working everywhere else.

I am stumped. I will need to test again from scratch. I am not sure what I am doing wrong.

@Nerdyvedi
Copy link

@Monduiz . Were you able to solve this ? I am getting the same error. Not sure if you would still remember how you solved it though

@Monduiz
Copy link
Author

Monduiz commented Jul 4, 2020

@Nerdyvedi It has been awhile but if I remember I decided to do it differently than with this library. Once you have geojsons, it was trivial to get what I needed. Basically, I wrote a script that extracted features I need from OSM and then made my calculations in R. I don't know if this will be useful to you but you can see the code and final project here:

buildings monitoring with OSM

Honestly, today I probably would write a Django app with a backend that pulls all this in PostGIS.

@Nerdyvedi
Copy link

@Monduiz Thank you so much for your help.

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

No branches or pull requests

3 participants