In BatchData property search api there is another amazing way to search for properties which works around geo-coordinates. Here are some of them:
geoLocationDistance
geoLocationBoundingBox
geoLocationPolygon
initialGeoStatus
geoStatus
1. geoLocationDistance
Batch Data allows you to search for properties in a radius of certain distance from a particular location of map. For this type of search we need to use geoLocationDistance
option in the searchCriteria
. geoLocationDistance
expects two inputs geoPoint
which is a geolocation in terms of latitude & longitude. For the radius from the geolocation you can use multiple options distanceMeters
, distanceKilometers
, distanceFeet
, distanceYards
& distanceMiles
which is going to be a numberic value.
E.g. Searching for properties within 5 miles radius from a geolocation looks as below:
{
"searchCriteria": {
"address": {
"geoLocationDistance": {
"geoPoint": {
"latitude": 33.44607127006081,
"longitude": -112.07385395154594,
"distanceMiles": 5
}
}
}
}
}
2. geoLocationBoundingBox
Batch Data also allows you to search for properties in a rectangular area on map defined by two geopoints. This requires you to use geoLocationBoundingBox
filter which seeks two inputs nwGeoPoint
(north west geo point) & seGeoPoint
(south east geo point) which are pair of latitude & longitude.
E.g. Searching for properties within a rectangle defined by two geo points can be achieved as below:
{
"searchCriteria": {
"address": {
"geoLocationBoundingBox": {
"nwGeoPoint": {
"latitude": 33.5174191396122,
"longitude": -112.20351715416759
},
"seGeoPoint": {
"latitude": 33.33403536533079,
"longitude": -111.96181793541759
}
}
}
}
}
3. geoLocationPolygon
Batch Data does not restrict your search for properties to a rectangular or circular area on map; it also allows you to search in a area polygon on map as well. This requires you to use geoLocationPolygon
filter which seeks at least three distinct inputs as geoPoints
in an array which are pairs of latitudes & longitudes.
[Please note that to make sure that the polygon you are providing coordinates is a closed polygonal shape; you need to repeat the first geo point again at the end which means that instead of 3 it will actually turn out to be four geo points]
E.g. Searching for properties within a polygon defined by 5 distinct geo points can be achieved as below:
{
"searchCriteria": {
"address": {
"geoLocationPolygon": {
"geoPoints": [
{
"latitude": 33.462215067222054,
"longitude": -112.18664636068601
},
{
"latitude": 33.3492934069225,
"longitude": -112.1914528792407
},
{
"latitude": 33.29306454094968,
"longitude": -112.13377465658445
},
{
"latitude": 33.29765601211365,
"longitude": -111.97584618978757
},
{
"latitude": 33.458777996534295,
"longitude": -111.98202599935789
},
{
"latitude": 33.462215067222054,
"longitude": -112.18664636068601
}
]
}
}
}
}
4. initialGeoStatus
Batch Data Search Property API also allows one to search for properties that have a certain Initial Geo Status (accuracy of the initial geo location of the property). To achieve this you need to use ginitialGeoStatus
filter. This filter allows multiple ways to search for a geo status which are equals
, contains
, startsWith
, endsWith
, inList
, notInList
& matches
.
E.g. To search for properties in Phoenix, Arizona that have initial geo status from a list the query should look as below:
{
"searchCriteria": {
"address": {
"query": "Phoenix, AZ",
"initialGeoStatus": {
"inList": [
"ZIP + 4 centroid",
"ZIP + 2 centroid",
"County Level",
"Rooftop",
"Interpolated Rooftop",
"Parcel Centroid",
"5-digit ZIP code centroid"
]
}
}
}
}
5. geoStatus
Batch Data Search Property API also allows one to search for properties that have a certain Geo Status (accuracy of the geo location of the property). To achieve this you need to use ginitialGeoStatus
filter. This filter allows multiple ways to search for a geo status which are equals
, contains
, startsWith
, endsWith
, inList
, notInList
& matches
.
E.g. To search for properties in Phoenix, Arizona that have geo status from a list the query should look as below:
{
"searchCriteria": {
"address": {
"query": "Phoenix, AZ",
"initialGeoStatus": {
"inList": [
"ZIP + 4 centroid",
"ZIP + 2 centroid",
"County Level",
"Rooftop",
"Interpolated Rooftop",
"Parcel Centroid",
"5-digit ZIP code centroid"
]
}
}
}
}
Important Options:
While using geo-coordinate searches it is important to understand the following options
areaPolygon : This option indicates whether the response object should contain the area polygon data or not. (possible values: true/false). Enabling this option (areaPolygon : true) will allow one to get geocoding polygon in the response. This enables you to show the area polygon on a map for your UI. areaPolygon returns values for polygons in terms of two values boundingBoxNw & boundingBoxSe which when combined form a polygon on the map.
boundingBoxNw : Is a geopoint containing latitude and longitude for the North-West point of the areaPolygon.
boundingBoxSe : Is a geopoint containing latitude and longitude for the South-East point of the areaPolygon.