Geocoding

Running Geocode

Removing Geocode

- Wiping Single listing

- Wiping whole board

Mapping for Geolocation

Troubleshooting

- Listing still isn't geocoding

- Listing failed to geocode

- How many listings haven't been geocoded

How many ACTIVE listings haven't been geocoded

- Example problems

- NOTE

Running Geocode Command

[maponics: no neighborhood or subdivision found] = is fine, can be ignored.

[geocoder: inexact result] = can't be mapped, doesn't get pinpointed on a map.

 

source=G = Geocoded by google.

source=B = Geocoded by board coordinates.

 

If the listing is already geocoded (even by google), any future geocodings will say source=B.

 

Removing Geocoding 

Geocoder only runs on a listing if it has no Geo:{} object. To remove geocoding (to try again) for a single listing, here's the command:

To then update the geocoding, run this command:

./foreground.sh ./runner.py find_and_regeocode board# '{"board":"#","mls_number":"#####"}

Wiping whole board: (ONLY USE WHEN MAPPING A NEW BOARD- this is if you start full_prop before mapping geo_addr)

When mapping a new board, you might need to wipe the whole board in case you forget to map the lat/long or geo_addr before full_prop. Here's an example with board 358: 

 

db.properties.updateMany({board:358}, {$unset: { longitude: "", latitude: "", lng_lat: "", geo: ""}})

 

Mapping for Geolocation

In order for a listing to be geocoded, it needs a latitude and longitude field

If the board doesn't provide a latitude or longitude field, you can map a custom field called geo_addr that combines the following fields:

So in rope, you can combine them in the following way:

Troubleshooting

Q: Listing still isn't geocoding

A: The listing's coordinates and county may not match up. Check if the coordinates are located within the county boundaries stated within our system.

 

Q: Listing failed to geocode; [geocoder: inexact result]

A: This is due to the fact that we were unable to receive a ROOFTOP or RANGE_INTERPOLATED value from the Google Maps API. These are location_type values that our geocoder depends on for the precise location of the listing. Click here for more information about the location_type values.

Here is how to get the results we would receive from Google Map's API regarding a specific address: 

Example:

1) grab example listing address and try to find it on google maps
2) find the listing in the database

if it has:
"lng_lat" : [ -90.0827745, 29.9298843 ]

lng_lat is also used for the polygon.

then it should be geocoded

3) if it should be geocoded, contact Igor

How to check how many properties haven’t been geocoded:

db.properties.find({board:369, enabled:true, geo:{$exists:false}}).count()


How many ACTIVE listings haven’t been geocoded:

db.properties.find({board:369, enabled:true, geo:{$exists:false},status:"ACTIVE"}).count()

 

Example problem- listing in the wrong place on the map: 

Say a listing is in the wrong place on the map search. You first look into rope to see if there is the geo_addr field. If it isn't there, go ahead and map it. Here's an example:

Now, what you want to do is to test it by removing the geocode of the one listing that is giving you grief. Use this in the dabase (cid <board#>):  db.properties.updateOne({mls_number:"#####", board:###}, {$unset: { longitude: "", latitude: "", lng_lat: "", geo: ""}}) . 

(replace the #'s with the correct board and mls number)

Now, exit out of the db and in cd scripts, refresh the listing, and then run the geocode command: ./foreground.sh ./runner.py geocode <board#>

If it doesn't work, the listing may not have the data we need to geocode it. 

Note: if you try to geocode a listing twice, it will not work. You will need to remove the geocoding first each time. 

Back to top