GEOCODE
The GEOCODE command performs reverse geocoding - it converts a picked point to its postal address.
Pick a point and GeoCode will display its full street address (or
the address of the nearest location).
In AutoCAD you need to first set the _GEOGRAPHICLOCATION (use the WORLD-MERCATOR coordinate system) and your
current layer must be ON.
In Map/Civil you need to first set the coordinate system of your
map.
GEOCODEA
The GEOCODEA command performs standard (forward) geocoding - it prompts
for a full address (free-format text string) and returns its lat-long coordinates plus it creates
a geomarker on this position (with the address as its label). You can also paste a list of addresses e.g. from Excel.
Usage
Load the GEOCODE utility (e.g. with the APPLOAD command) and choose the function from the GeoCode ribbon tab.
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 as 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)
If you want to insert the address to your drawing as a label, you
can use a block with a attribute (e.g. RotLabel1.dwg 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;
************************ IMPORTANT ****************************************
Please note that Google API limits to max. 2,500 requests per 24 hour.
Otherwise you will get the "OVER_QUERY_LIMIT" or "REQUEST_DENIED" results.
Since 2018 you MUST USE your personal API key to access Google Maps API
for geocoding - see: https://console.developers.google.com/
You can then use the following parameters to set your personal Google
and W3W API keys and what3word language for GeoCode:
(setq GoogleAPIkey "AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaA")
(setq w3wAPIkey "12345XYZ")
(setq w3wlang "fr")
***************************************************************************
You can use geocode-debug LISP variable to display debug information:
(setq geocode-debug T)
Screenshots
GeoCoding an address to get its location
Installation and Uninstallation
The installer that ran when you downloaded this plug-in from AutoCAD Exchange has already installed the plug-in. You may need to restart AutoCAD to activate the plug-in. To uninstall this plug-in, simply rerun the installer by downloading it again from Exchange, and select the 'Uninstall' button, or you can uninstall it from 'Control Panel\Programs\Programs and Features' (Windows 7/8) or Add/Remove Programs (Windows XP), just as you would uninstall any other application from your system. The panel on the Plug-ins tab will not be removed until AutoCAD is restarted.
Additional Information
- License: GeoCode is a free utility by CAD Studio - see Freeware.
Known Issues
None
CAD Studio a.s. is a leading Czech Autodesk Platinum Partner (& Autodesk Top Dealer 1994-2016), Autodesk Developer, Autodesk Consulting Partner, Autodesk Training Center and HP Preferred Partner. Visit
www.cadstudio.cz to find out more about us.
Support Information
Email us at
info@cadstudio.cz for support, feedback or requests for enhancements.
Version History
1.1
First version for AutoCAD Apps Exchange (AutoCAD 2014+2015).
1.2
what3words added
1.3
AutoCAD 2018 support, what3words API v2 used.