Intro: It's easy with OSM XML to run my software algorithm converting the XML to my custom software objects representing routing graph: You have ways with easy links to the (ordered) nodes constructing the segment with lat/lon.
Problem: Usually one starts with data as Shapefile, so the easy solution is to use Shape->OSM converter. I want to work directly with the Shapefiles.
Question: It's easy to import Shapefile to PostgreSql and using PostGis to query bounding boxes of the coverage based on geospatial logic. The next step is to use pgRouting in order to parse the raw Shapefile data (roads) to software objects representing the routing graph, for example in Java something like:
class Node() {
double lat;
double lon;
int nodeId;
}
class Segment() {
LinkedList byOrderNodes; //of type class Node above
int segmentId;
boolean oneWay;
}
class graph() {
ArrayList segments; //of type Segment above
}
How to achieve this with pgRouting - What queries and functions to use?
Note - I don't mind between Python/Java/etc.