CAD Studio - CAD/GIS/PLM solutions
English Deutsch Cesky Slovensky

GeoCode GeoCode - geocoding and reverse geocoding in AutoCAD

Converts street addresses and what3words to/from lat-long coordinates


GeoCode - geocoding tools for AutoCAD

GeoCode is a LISP utility for AutoCAD 2014, 2015, 2016, 2017, 2018... (plus Architecture, Civil 3D, Map 3D, MEP) which automatically creates street address for picked points (location) and converts full addresses to lat-long coordinates and geomarkers. The What3Words command variants use the 3-word address code. GeoCode supports the AutoCAD Live Maps. This function uses internet access to Google API and what3words API.

Map

Setup:

Load this utility with _APPLOAD.

Automatically install GeoCode from Autodesk Apps, or copy the whole "GeoCode.bundle" folder as a subfolder to:

C:\Program Files\Autodesk\ApplicationPlugins

or (XP):

C:\Documents and Settings\<usrname>\Application Data\Autodesk\ApplicationPlugins

or (Win7/8/10):

C:\Users\<usrname>\AppData\Roaming\Autodesk\ApplicationPlugins

-- GeoCode will be loaded automatically (see _APPAUTOLOADER)

Usage:

Load the GeoCode.VLX with APPLOAD and start the GEOCODE command. Pick a point and GeoCode will display its full street address (or the address of the nearest location). The GEOCODEA command prompts for a full address and returns its lat-long coordinate plus creates a geomarker on this position (with the address as its label). In AutoCAD you need to first set the _GEOGRAPHICLOCATION and your current layer must be ON.

The commands GEOCODEW3 and GEOCODEAW3 use the What3Words service to convert a location to/from a 3-word address code. In Map/Civil you need to first set the coordinate system of your map.





LISP interface, macros

You can also use two LISP interfaces for reverse geocoding (works in any version of AutoCAD) - e.g.:

(revgeocodeLL '(48.9669 14.4768))

evaluates to:

"Tylova 153/17, 370 01 Ceske Budejovice, Czech Republic"

nonsense coordinates evaluate to:

"ZERO_RESULTS"

and:

(revgeocode (getpoint))

works like the GEOCODE command, returns the address string.

You can also use a LISP interface function to convert an address to a lat-long point:

(geocodeLL "Tylova 17, Ceske Budejovice")

returns a list:

(48.9666 14.4768)

And in the What3Words variant - the function:

(revgeocodeLLW3 '(48.9669 14.4768))

evaluates to:

"purses.casually.question"

while:

(geocodeLLW3 "purses.casually.question")

returns a list:

(48.9669 14.4768)

If you want to insert the address to your drawing as a label, you can use a block with a attribute (e.g. RotLabel1 from CADforum.cz) and add the following menu macro to your ribbon (make sure the TEXTEVAL variable is set to 1):

^C^C(setq p(getpoint"Point:") s(revgeocode p));\_-INSERT;RotLabel1;!p;1;;0;!s;

Please note that Google API limits to max. 2,500 requests per 24 hour. Otherwise you will get the "OVER_QUERY_LIMIT" results.

You the following parameters to set what3word language (beta) and your own API key:

(setq w3wlang "fr"))
(setq w3wAPIkey "12345XYZ"))

You can also use geocode-debug LISP variable to display debug information:

(setq geocode-debug T)


History

  • V1.3 - updated for new What3Words API v2
  • V1.2 - added What3Words functionality
  • V1.1 - forward geocoding added (addr to latlong)
  • V1.0 - first releas

Freeware License

GEOCODE is a free utility by CAD Studio, do not publish it online on other than CADstudio's web servers. Contact CAD Studio for feature enhancements.


Exchange Apps Download the free GeoCode application (for AutoCAD 2018-2014)


Facebook Twitter Google+ YouTube LinkedIn
© 2017 CAD Studio a.s. | contact | webmaster | privacy