Web services
Map data download API documentation, available via HTTP-JSON/XML service.
URL base service:
- JSON: https://lb.cercalia.com/services/json?key=<API KEY*>
- XML: https://lb.cercalia.com/services/xmlgeo?key=<A KEYPI*>
* API KEY. Same KEY used in maps API js
HTTP requests in GET or POST
Response in JSON / XML format
Download the polygon geometry (in WKT format) of a municipality or a postal code
REQUEST
Example:
&cmd=geoment&munc=
ESP280796&tolerance=0&cs=4326
Where:
munc / pcode / subregc / poic= Municipality code / ZIP-Postal Code / Region code
ctryc= country code (ISO 3 digits). Mandatory for &pcode=
tolerance= polygon simplification, in meters. If 0, returns the original data
cs= coordinate system of the data. Use 4326 for geographical system lat,long
Example:
- Zaragoza municipality (Spain):
cmd=geoment&munc=ESP502973&tolerance=0&cs=4326
- London municipiality (Westminster, UK):
cmd=geoment&munc=GBRE02AP&tolerance=0&cs=4326
- Madrid region:
cmd=geoment&subregc=ESP28&tolerance=0&cs=4326
- Postal Code 06405 (USA):
cmd=geoment&pcode=06405&ctryc=USA&tolerance=0&cs=4326
RESPONSE
<cercalia cmd="geoment" version="1">
<poi category_id="D00SIGPAC" geometry="Z" id="D00_43157_0_0_130_66_2" subcategory_id="-1">
<name>43157:0:0:130:66:2</name>
<info>43157|IM|0.023681334|PARCIAL|12</info>
<ge>
<city id="ESP17240012883186">Tortosa</city>
<municipality id="ESP431554">Tortosa</municipality>
<subregion id="ESP43">Tarragona</subregion>
<region id="ESPCAT">Catalunya</region>
<country id="ESP">España</country>
</ge>
<coord x="57792" y="4953695"/>
<wkt tolerance="0.0">
MULTIPOLYGON(((0.519285 40.791313,0.519251 40.791444,0.519088 40.791424,0.519055 40.79142,0.519098 40.791295,0.519285 40.791313)))
</wkt>
</poi>
<server>http://cercalia-tomcat-lbs-instance1:8080</server>
</cercalia>
Response includes a WKT with the route polyline, using standard "Well-known Text Representation for Geometry".
Geometry Type | Text Literal Representation | Comment |
---|---|---|
Point | 'POINT (10 10)' | a Point |
LineString | 'LINESTRING ( 10 10, 20 20, 30 40)' | a LineString with 3 points |
Polygon | 'POLYGON ((10 10, 10 20, 20 20, 20 15, 10 10))' | a Polygon with 1 exteriorRing and 0 interiorRings |
Multipoint | 'MULTIPOINT (10 10, 20 20)' | a MultiPoint with 2 points |
MultiLineString | 'MULTILINESTRING ((10 10, 20 20), (15 15, 30 15))' | a MultiLineString with 2 linestrings |
MultiPolygon | 'MULTIPOLYGON ( ((10 10, 10 20, 20 20, 20 15, 10 10)), ((60 60, 70 70, 80 60, 60 60 ) ))' | a MultiPolygon with 2 polygons |
GeomCollection | 'GEOMETRYCOLLECTION (POINT (10 10), POINT (30 30), LINESTRING (15 15, 20 20))' | a GeometryCollection consisting of 2 Point values and a LineString value |
Download the polyline geometry (in WKT format) of a street
Get the polyline geometry of a street, from a street ID, or a coordinate + radius/postal code.
REQUEST
Example:
&cmd=geoment&rqge=st&mo=37.767951111,-3.790683886&mocs=gdd&cs=4326&tolerance=0&stc=&pcode=23004&rad=500&buffer=
Where:
mo=Y,X (optional if &stc= is used)
mocs=gdd coordinate system used in &mo=
cs=4326 coordinate system used in data. Use 4326 for geographical system lat,long
tolerance= polyline simplification, in meters. If 0, returns the original data
stc= street code (optional if &mo= is used). This paramether have priority over &mo=
pcode= postal code (optional) -> if used, response includes only the street segments inside the postal code.
rad= radius (optional) -> if used, response includes only the street segments inside and intersected by radius. This paramether have priority over &pcode=. Use only with &mo=, not &stc=
buffer= returns a buffer around the street. Value in meters (optional).
RESPONSE
<cercalia cmd="geoment" version="1">
<ge id="ESP080193000092155" type="st">
<geometry>
<wkt>
MULTILINESTRING((2.19227720000266 41.4045097000002,2.1939068000009 41.4049257000016),(2.19031069999947 41.4042851999981,2.19192439999684 41.4046852000012),(2.19185739999579 41.4044059000003,2.19227720000266 41.4045097000002),(2.18883240000163 41.4036521999978,2.19058060000338 41.4040945999973),(2.19058060000338 41.4040945999973,2.19185739999579 41.4044059000003),(2.19192439999684 41.4046852000012,2.19351620000183 41.4050827000025),(2.18855479999843 41.4038593999969,2.19031069999947 41.4042851999981))
</wkt>
</geometry>
</ge>
</cercalia>
Response includes a WKT with the route polyline, using standard "Well-known Text Representation for Geometry".