Location Data
Query & export
Filter by properties and by location in one request — for example, active warehouses with more than 1,000 capacity within 5 km.
Example
curl -X POST "https://orviamaps.ir/api/v1/collections/warehouses/query" \
-H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{
"where": { "status": { "eq": "active" }, "capacity": { "gt": 1000 } },
"near": { "lat": 35.72, "lng": 51.33, "radius": 5000 },
"orderBy": { "field": "distance" },
"limit": 20
}'{ "total": 2, "count": 2, "offset": 0, "features": [
{ "id": "ft_…", "title": "Warehouse Azadi", "location": { "lat": 35.6997, "lng": 51.338 },
"properties": { "status": "active", "capacity": 1200 }, "distanceM": 2370, … } ] }where
Keys are your fields (or title, created_at, updated_at); conditions are combined with AND. A plain value means eq: { "status": "active" }.
| Parameter | Type | Description |
|---|---|---|
| eq, ne | any | Equal / not equal. |
| gt, gte, lt, lte | number, date, string | Comparisons (dates compare in time order). |
| in, nin | list | One of / none of (up to 100 values). |
| contains | string | Substring match on a string field. |
| exists | boolean | The point has (true) or lacks (false) the property. |
| or | list | Any of several condition objects: { "or": [ { "capacity": { "gte": 3000 } }, { "manager": "Ali" } ] } |
Values are checked against the field's type; an unknown field or operator answers 400.
near & bbox
| Parameter | Type | Description |
|---|---|---|
| near | { lat, lng, radius } | Points within radius meters (up to 100 km). Results carry distanceM. |
| bbox | [minLng, minLat, maxLng, maxLat] | Points inside a rectangle — e.g. the visible map. |
Order & pages
| Parameter | Type | Description |
|---|---|---|
| orderBy.field | string | Any field, title, created_at, updated_at, or distance (with near). Default: distance with near, otherwise newest first. |
| orderBy.direction | asc | desc | Sort direction. |
| limit | 1–1000 | Default 50. |
| offset | 0–10000 | Skip results; total tells how many match. |
Map viewport (GeoJSON)
For a web map, load the points of the visible area as a GeoJSON FeatureCollection — ready for a MapLibre geojson source. Add where (URL-encoded JSON) to filter, and limit (up to 1000, default 500). A viewport request is a spatial query: 5 units.
GET https://orviamaps.ir/api/v1/collections/properties/features?bbox=51.30,35.70,51.45,35.80&limit=500 GET https://orviamaps.ir/api/v1/collections/properties/features?bbox=51.30,35.70,51.45,35.80&where=%7B%22status%22%3A%22for_sale%22%7D
{ "type": "FeatureCollection", "name": "properties", "total": 31,
"features": [ { "type": "Feature", "id": "ft_…",
"geometry": { "type": "Point", "coordinates": [51.3735, 35.7795] },
"properties": { "title": "Apartment in Saadat Abad · 2 bed · 120 m²",
"listing_id": "RE-1001", "status": "for_sale", "price": 21800000000, … } } ] }The query endpoint returns the same shape with "format": "geojson" in its body.
On a map
The base map first, then the collection you choose — reloaded when the view changes:
const map = new maplibregl.Map({
container: "map",
style: "https://orviamaps.ir/api/v1/style.json?key=YOUR_API_KEY", // base map only
});
map.on("load", () => {
map.addSource("properties", { type: "geojson", data: { type: "FeatureCollection", features: [] } });
map.addLayer({ id: "properties", type: "circle", source: "properties",
paint: { "circle-radius": 6, "circle-color": "#fafafa" } });
const load = async () => {
const b = map.getBounds();
const bbox = [b.getWest(), b.getSouth(), b.getEast(), b.getNorth()].join(",");
const res = await fetch(`/api/properties-in-view?bbox=${bbox}`); // your server adds the key
map.getSource("properties").setData(await res.json());
};
map.on("moveend", load);
load();
});Large collections
GeoJSON suits collections up to tens of thousands of points. For larger ones the same collection will be available as vector tiles at /api/v1/collections/{name}/tiles/{z}/{x}/{y}.pbf — a separate source next to the base map, so nothing about how you combine them changes.
Export
The whole collection as a GeoJSON FeatureCollection — ready for QGIS, MapLibre or any GIS tool. 10 units.
curl "https://orviamaps.ir/api/v1/collections/warehouses/export" -H "Authorization: Bearer YOUR_API_KEY" -o warehouses.geojson