CAD Studio - CAD/CAM/GIS/BIM/PLM solutions
English Deutsch Cesky Slovensky Magyar
NEW COMPANY WEB SITE NOW ON arkance.world

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, 2019, 2020, 2021, 2022, 2023, 2024... (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.

In all commands, you can use the "Keep" option to toggle the address label visibility. Use the command GEOCODEAPIKEYS to set your personal API keys for Google and W3W.





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 and ATTDIA to 0):

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

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

(setq geocode-debug T)

*** 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 for any access to Google Maps geocoding API 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 "AaAaAaAaAaAaAaAaAaAaAaAaAaAaA")
(setq w3wAPIkey "12345XYZ")
(setq w3wlang "fr")

Alternatively, you can preset these parameters using the command GEOCODEAPIKEYS (to the Registry).

How to get your personal Google API key? Register on the Google Cloud Platform APIs web site, create a Project and add a Credential:
API
For your personal W3W API key, go to https://developer.what3words.com




History

  • V1.6 - added the Keep option for geocoding labels; handles unknown addresses and W3W codes
  • V1.5 - updated for new What3Words API v3, new command GEOCODEAPIKEYS, first 5 W3W calls w/o API key
  • V1.4 - added support for Google Maps API
  • 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
Autodesk APP STORE
Download the free GeoCode application (for AutoCAD 2024-2014)


Facebook Twitter YouTube LinkedIn
© 2024 CAD Studio s.r.o. (ARKANCE CZ) | contact | webmaster | privacy