-
Notifications
You must be signed in to change notification settings - Fork 120
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
adapting this to other datasources #91
Comments
Hey, This is a fine place to ask. I'm surprised to hear you say that there are assumptions made specifically for the mapbox format. Do you mind expanding on some of the specifics of what didn't work when you tried? There are some inconsistencies at the moment with how the formatters handle ids. And in particular with the mapbox format, if the geometry is a multipolygon, we clone that feature and create a separate one for each polygon in the multipolygon. But otherwise, I don't think that there are other assumptions baked into the queries for each format. We have been moving to a system where some transformations happen at the python level, and not in sql. Those are also meant to be format agnostic. |
In one of the pgsql files, I'm doing very simple joins:
but when I go to get a tile, I get errors like:
This seems like it's expecting "output" from the SQL file in a certain way (either as a sub-query, or certain projections coming in, I'm not quite sure). Do the geometries returned need to be in a specific projection? In looking at the commands provided in this repo, it looks like there are size limitations being imposed, is this assumption required? Maybe I'm mis-interpreting these errors, and if so, do you have a different suggestion? |
Try removing the semicolon at the end of your query to see if that helps. It initially does a query to figure out what the columns need to be. It could just be that the semicolon is separating out the limit into a separate query for the db, and that's why it's blowing up. |
It does not:
|
Can you try putting in a breakpoint or printing out the query that it's trying to run? That might reveal what's going on. I think it's going to break later on because it expects the columns to be named |
eek, those columns are named that way, but the markdown interpreter make the underscores translate into bold instead. The problem, after doing some digging, is that the command
is appending
If I print the same thing it's trying to execute before it doing so, I see
|
Ah, understood about the underscores around the property names. I've had that happen to me too. :) That semicolon getting inserted is odd, because we're not encountering that on our end. Not sure where it's coming from. Maybe as a quick fix what we can do in the columns query is trim the query for whitespace, and then semicolons. Something like:
|
So, I'm stupid, I'd edited the config file, and I was pointing to the wrong place. The semi-colon was my fault. That said, upon fixing it, I'm getting tiles returned, but they're blank (or at least not rendering the way I'm expecting them to). The last time I setup TileStache (using the core version), it took a while to render tiles, and I'm expecting this one to take a bit too. There's no errors, and I'm getting successful tile requests. Is there something else I should be looking for? |
I'd suggest logging the actual queries that the database sees. Maybe the bounding box part of the query isn't right. |
I've double-checked all the requirements listed in the comments, and ensured that my geometries were in spherical mercator. When I do this, and manually run the logged query, I get geometries returned. I also log the query at https://github.com/mapzen/TileStache/blob/integration-1/TileStache/Goodies/VecTiles/server.py#L544, which seems to be doing the same thing. If I run it manually, it seems to work properly, but when I load the map (using Leaflet.MapboxVectorTIle), I'm seeing tiles (approximately 31 bytes over the wire) that don't show any geometries. However, when I point to the mapzen end-point, I see plenty of geometries using the same technique. It seems like there's something in my queries or configuration (or perhaps a non-obvious bug) that is causing these queries to return nothing. I've put my tilestache.cfg below, to make sure there's nothing weird going on here.
|
The config looks right to me. The only thing I can think of is the Otherwise, I'd recommend trying to see if the If that returns data for your layers, then the next place I would look is to see if something in the formatter itself is causing it to drop the features. |
@jtsmn can you also try hitting the GeoJSON endpoint (.json) for a sample of your tiles and comparing to the MVT ones? This will help narrow down a possible issue with the MVT formatter. Thanks! |
Alright, so if I print the output from get_features(), I do see features being printed to the console. However, even hitting a URL that I know just printed features to the console with the GeoJSON endpoint does not work, as I get:
Which looks similar to the .mapbox endpoint, although I can't fully read that in the browser debug console. EDIT: Upon further inspection, my POIs layer is working fine, it's only the buildings layer that's breaking, which suggests there's a disconnect between my query and the renderer. I'll keep digging and report back if I find anything. |
The problem ended up being that the Thus, for the buildings layer, I needed it to read:
(or remove the I'm going to close this. Sorry for your time being spent around a stupid issue, but I hope this helps someone in the future. |
No worries, I'm glad that you were able to figure it out. |
Thanks - your pain will hopefully help us to help others ;) |
Hi,
I'm not sure if this is the right place to ask this question, but I haven't been able to find other resources in this space, so I figured I'd ask here.
I'm trying to adapt this and the mapzen TileStache fork to a differently formatted dataset (a subset of OSM data for now, but extending into other things in the future). What are the assumptions of what gets returned from the SQL queries for each zoom level? I've read through the various .pgsql files, and tried to replicate them for my own dataset, but it looks like there's some assumptions being made in the VecTiles code for the .mapbox extensions. Are these assumptions enumerated someplace?
If not, could they be documented? I'd prefer not to figure them out myself, but can if needed.
Thanks
The text was updated successfully, but these errors were encountered: