Re: [Talk-in] Understanding "unprojection"

2018-11-11 Thread Aruna S
Sorry, to come to your other questions:

> I haven't published this script online because I'm afraid it'll get used
recklessly and cause excess load on the target tile server.It generates a
Z/X/Y URL list of tiles at multiple zoom levels. Then I used a download
manager to download the tiles with some time gap (so I don't trigger a
server lockout), with z/x/ folder paths maintained.

A python library does this, where it takes a bounding box and a zoom, and
generates z/x/y at zooms for the bounding box. Is your script doing
something different from this?

Warmly,
Aruna
___
Talk-in mailing list
Talk-in@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-in


Re: [Talk-in] Understanding "unprojection"

2018-11-08 Thread Aruna S
Hey Nikhil!

Thanks a lot for taking the time to answer this. I did not know about these
verifiers and validators at all, so I learnt a little bit more about GIS
weirdness. : )

I ran the geojson through the verifier, and tried running my script with
the updated geojson. Unfortunately, it seems to be something else - I am
not sure if tile boundaries or other complications with the mbtiles files
is causing this issue, since these polygons aren't able to be cut up from
any mbtiles file that I ran them on.

The question is now present on the GIS StackExchange at
https://gis.stackexchange.com/questions/301975/mbtiles-extracts-does-not-work-with-my-geojson
.

Thanks again, Nikhil! : )

Warmly,
Aruna
___
Talk-in mailing list
Talk-in@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-in


Re: [Talk-in] Understanding "unprojection"

2018-11-08 Thread Nikhil VJ
Hi Aruna,

This would be a good question to post on https://gis.stackexchange.com ,
there are good technical GIS experts there from around the world, and
there's points to be earned so good incentives for properly resolving. Also
check if a similar question has already been posted there.

Taking a shot:
I'm not sure if the "right hand rule" validation/rectification for geojson
polygons would work here or not, but it did help me in a calculation
function using python's geojson_utils module. The area was computing to be
negative, and reversing the order of the co-ordinates of the polygon set it
right.

More theory on Right Hand Rule and rectifier tool available here:
https://mapster.me/right-hand-rule-geojson-fixer/
Validation site that flags if your polygons are adhering to the right hand
rule or not: http://geojsonlint.com

My brief understanding: It's a validation for geojson that has been made
non-compulsory in recent times, but still causes problems at some places.
When traversing through a polygon, the math formulae assume one side to be
'in' and the other side 'out'.
A quick rectification without having to alter the polygon data : if area
computes to be negative (<0), then multiply by -1 to make it positive. But
I don't know how this may apply to your specific function calculation.

I ran your geojson through the tool and it has reversed the order of your
polygons' co-ordinates to solve for right hand rule. So try the reversed
version in your program and let us know if you were able to resolve your
problem.

If this works, then please post this question on gis.stackexchange.com and
share the link so I can post the right hand rule answer there!
If this doesn't work, then definitely post this on gis.stackexchange.com
all the same :)

--
Cheers,
Nikhil VJ
+91-966-583-1250
Pune, India
http://nikhilvj.co.in


On Thu, Nov 8, 2018 at 8:21 AM Aruna S  wrote:

> Hi everyone!
>
> I am working with the mbtiles-extracts library:
> https://github.com/mapbox/mbtiles-extracts. Given an mbtiles file and a
> geojson, the library extracts mbtiles cutouts of the polygons in the
> geojson.
>
> Except, it does not work for some geojsons.
>
> As documented in https://github.com/mapbox/mbtiles-extracts/issues/10, it
> does not work for any polygon present in the following geojson for the
> mbtiles listed below:
>
>- MBTILES: Pretty much every tileset on
>https://osmlab.github.io/osm-qa-tiles/historic.html. Can definitely
>replicate it using for
>
> https://s3.amazonaws.com/mapbox/osm-qa-tiles/historic/2008-Q1-qa-tiles.mbtiles
>- GEOJSON:
>https://gist.github.com/arunasank/c98ef28abd51b54579c7609f8ebc1de1
>
> When I debug, I see that:
> * This function:
> https://github.com/mapbox/mbtiles-extracts/blob/master/index.js#L175
> returns a falsy value for all the features in the above geojson, resulting
> in a falsy value here:
> https://github.com/mapbox/mbtiles-extracts/blob/master/index.js#L58-L62
>
> Any help in understanding why these polygons are different from other
> polygons, or if there's a pattern I am missing, would be really helpful!
>
> If there are other mailing lists where this could be answered, please
> point me to them.
>
> Warmly,
> Aruna
> ___
> Talk-in mailing list
> Talk-in@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/talk-in
>
___
Talk-in mailing list
Talk-in@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-in


[Talk-in] Understanding "unprojection"

2018-11-07 Thread Aruna S
Hi everyone!

I am working with the mbtiles-extracts library:
https://github.com/mapbox/mbtiles-extracts. Given an mbtiles file and a
geojson, the library extracts mbtiles cutouts of the polygons in the
geojson.

Except, it does not work for some geojsons.

As documented in https://github.com/mapbox/mbtiles-extracts/issues/10, it
does not work for any polygon present in the following geojson for the
mbtiles listed below:

   - MBTILES: Pretty much every tileset on
   https://osmlab.github.io/osm-qa-tiles/historic.html. Can definitely
   replicate it using for
   
https://s3.amazonaws.com/mapbox/osm-qa-tiles/historic/2008-Q1-qa-tiles.mbtiles
   - GEOJSON:
   https://gist.github.com/arunasank/c98ef28abd51b54579c7609f8ebc1de1

When I debug, I see that:
* This function:
https://github.com/mapbox/mbtiles-extracts/blob/master/index.js#L175
returns a falsy value for all the features in the above geojson, resulting
in a falsy value here:
https://github.com/mapbox/mbtiles-extracts/blob/master/index.js#L58-L62

Any help in understanding why these polygons are different from other
polygons, or if there's a pattern I am missing, would be really helpful!

If there are other mailing lists where this could be answered, please point
me to them.

Warmly,
Aruna
___
Talk-in mailing list
Talk-in@openstreetmap.org
https://lists.openstreetmap.org/listinfo/talk-in