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

Vector provider is unnecessarily clipping 10 degrees off WGS84 layer #104

Closed
rburhum opened this issue Feb 26, 2013 · 3 comments
Closed

Comments

@rburhum
Copy link
Contributor

rburhum commented Feb 26, 2013

I understand that when we use Web Mercator, most tile services clip at +/-85 latitude, but we are getting the same behavior with the vector provider and WGS84 layers. The problem with this is that features that go beyond this (for example, grids drawn as vectors) are becoming incomplete.

Perhaps we should not do this with WGS84 vectors.

Repro case:

In PostGIS:

DROP TABLE if exists silly_box;
CREATE TABLE silly_box(gid serial PRIMARY KEY, name VARCHAR);
SELECT AddGeometryColumn('public', 'silly_box', 'geom', 4326, 'MULTIPOLYGON', 2);
INSERT INTO silly_box (geom, name) VALUES (ST_GeomFromText('MULTIPOLYGON(((-180 -90, 180 -90, 180 90,-180 90, -180 -90)))',4326),'The World');

Configuration:

            {
                 "provider":{
                    "name": "vector",
                    "driver" : "PostgreSQL",
                    "parameters": {
                                    "dbname": "test_tilestache", 
                                    "user": "postgres",
                                    "table": "silly_box"
                    }                    
                 },
                 "projection" : "WGS84"
              }

Actual result for 0/0/0.geojson

{"type": "FeatureCollection", "features": [{"geometry": {"type": "Polygon", "coordinates": [[[179.99999999999983, 85.05112877996989], [179.99999999999983, -85.0511287799699], [89.99999999645502, -85.0511287799699], [0.0, -85.0511287799699], [-89.99999999645502, -85.0511287799699], [-179.99999999999983, -85.0511287799699], [-179.99999999999983, 85.05112877996989], [-89.99999999645502, 85.05112877996989], [0.0, 85.05112877996989], [89.99999999645502, 85.05112877996989], [179.99999999999983, 85.05112877996989]]]}, "type": "Feature", "properties": {"name": "The World"}}]}

Expected result:
Half of the box where the 85's should be 90 (or 89.99999999)

@rburhum
Copy link
Contributor Author

rburhum commented Feb 27, 2013

After debugging for a bit, this was due to user error, there was a cached tiled that was messing up my tests. "projection" : WGS84 makes it have the right behavior. I went ahead and added a set of vector cache tests so I can be sure this is working. I am still cleaning it up so I can send a pull request

@rburhum rburhum closed this as completed Feb 27, 2013
@migurski
Copy link
Contributor

Thanks! Was going to look at this and then saw your tests.

@rburhum
Copy link
Contributor Author

rburhum commented Feb 27, 2013

Yeah, I spent sometime today looking at the clipping behavior. The only odd behavior was the polygon clipping - you'll notice the big note in my polygon tests :)

And of course, #103 is still a bug - with an easy workaround though.

On Feb 26, 2013, at 11:16 PM, migurski notifications@github.com wrote:

Thanks! Was going to look at this and then saw your tests.


Reply to this email directly or view it on GitHub.

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

2 participants