Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to customize osm2po logic in defining possible speed limits of ways. osm2po takes into account only class of road while I need to consider one more parameter: is road inside or outside some city, i.e. for example: speed limit for higway=trunk inside city = 60km/h while outside it should be equal to 90km/h. What is a proper way to implement such logic? Is it feasible at all to do withing osm2po? Or may be it better/easier to load graph data into Postgres/PostGIS using osm2po generated sql-script and do speed/cost corrections there (assuming that we already have all city borders loaded into Postgres/PostGIS db) and use pgRouting as routing engine? Any advices highly appreciated.

share|improve this question
up vote 1 down vote accepted

Using the osm2po-API, namely overriding are 5 lines of code. Nevertheless you need some extra info for the areas. Which way (id) belongs to a city, which one does not? If you only have a set of polygons, you can also override, boolean) but this influences the creation of the osm2po-graph only, not the pgRouting-table. The advantage here is, that you can query the geometry of each way instead of matching its ID to some external data.

Well, there is a third option, the which combines both advantages but is very critical to use because it gives you full access to a resolved way before writing it for later conversion steps.

share|improve this answer
Thank you, Carsten - I choose the last option and it works fine for me. – Andrew Aug 6 '13 at 13:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.