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

I can't set the url with args (from django path), such as Martin tile server #13

Open
mdtrooper opened this issue Oct 30, 2020 · 2 comments

Comments

@mdtrooper
Copy link

mdtrooper commented Oct 30, 2020

Code Sample, a copy-pastable example if possible

For example:

urlpatterns.append(path("garden/<z>/<x>/<y>.pbf", mvt_view_factory(Garden)))

Problem description

I worked with Martin tile server and they has the standard ":
<url>/{schema_name}.{table_name}/{z}/{x}/{y}.pbf

And your url is:

<url>/api/v1/data/example.mvt?tile=1/0/0

Expected Output

A vector tile.

Version Number

from requirements.txt:

Django==3.0.10
djangorestframework==3.11.1
djangorestframework-mvt==0.2.4

And python version (from Dockerfile):

FROM python:3.8

@henhuy
Copy link

henhuy commented Nov 17, 2020

I stumbled upon the same...
Most vector tile servers seems to have z,x,y in url path (not in query).
IMO this would be more consistent

@ioionu
Copy link

ioionu commented Feb 21, 2021

I think this is because djangorestframework-mvt uses django-rest-framework-gis's get_filter_bbox to generate the bbox and it only supports query_params. I have a forked branch of django-rest-framework-gis and a pull request for djangorestframework-mvt that does a pretty ham fisted job but works.

I suspect a better solution would be replicating get_filter_bbox in djangorestframework-mvt but would be nice to get some feedback before i try that.

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

3 participants