Adding restriction polygons in web app

Good day! I was wondering if it is possible to add a kml with areas restricting where the car can go, ie not allow the isochrone to go beyond a square, for example. This problem arises from the need to restrict my traveling route to a certain series of postcodes

Thanks!

Hi @aarondlc,

Just to clarify: Do you want to load an existing route or an existing isochrone into the maps interface and restrict it there?
Or do you want to generate a route (or an isochrone?) using the maps interface and restrict it_

For a generated route you can use avoid polygons to achieve this:


You would have to draw the restricting border as a polygon.

I just saw that this feature is broken for isochrones.

If it’s an existing route, there is no way to restrict this to a square using the web app

Best regards

I wanted to upload a kml which contains restriction polygons and then use the isochrone web application.
Its a shame, would have to resort to API then!
Thanks for the fast response!

Yes, thats not possible with the web app.

Our api as well takes only avoid polygons in geojson format. You would have to use a similar approach to the picture above and look into converting your kml to geojson.

Best regards

Hi again @aarondlc,

I just realized, that the aproach i suggested above is bul*****.
Instead of formatting your squared avoid polygon by hand like this, you can easily use
an avoid polygon with a hole like:


e.g.:

{"locations":[[9.2599,48.7912]],"range":[3000],"options":{"avoid_polygons":{"type":"Polygon","coordinates":[[[9.254608154296875,48.78707474633469],[9.277009963989258,48.78707474633469],[9.277009963989258,48.810085455472375],[9.254608154296875,48.810085455472375],[9.254608154296875,48.78707474633469]],[[9.255294799804688,48.78764024651802],[9.255294799804688,48.80935063287144],[9.276237487792969,48.80935063287144],[9.276237487792969,48.78764024651802],[9.255294799804688,48.78764024651802]]]}}}

Routing outside of the square would still be possible but if queried on the inside your isochrones will be restricted:
grafik

You might have to use a very “thin” polygon to stay below the area limit for the polygon if you want to use this for larger areas.

Best regards