How can I plot Lat and Long coordinates into AutoCAD

How can I plot Lat and Long coordinates into AutoCAD

Anonymous
Not applicable
20,436 Views
22 Replies
Message 1 of 23

How can I plot Lat and Long coordinates into AutoCAD

Anonymous
Not applicable

I have a csv file of Lat Long coordinates that I would like to plot onto a map in AutoCAD 3D. Currently we use this data to plot points into Google Earth but would like to transition to directly plotting into AutoCAD. The attempts I have made never scale the points correctly (They plot in a MUCH smaller scale compared to a map). Any help is appreciated

0 Likes
Accepted solutions (2)
20,437 Views
22 Replies
Replies (22)
Message 2 of 23

АлексЮстасу
Advisor
Advisor

Hi,

 

Most likely you have a "scale" difference due to different units (degrees, meters, feet) of coordinate systems. If the data is in degrees and is directly inserted into dwg, in which the units are meters/feet, then the distances between the points will be “small”, since degrees on Earth are many meters/feet.

 

1. Set in dwg the coordinate system required for operation - _MAPCSASSIGN.
2. Import your data from CSV or KML/KMZ into this dwg - _MAPIMPORT. When importing, check-specify the coordinate system of the imported data.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes
Message 3 of 23

ChicagoLooper
Mentor
Mentor
Accepted solution

You will the following:

  1. An appropriate coordinate system assign to modelspace.
  2. An appropriately formatted csv file.

Start with a clean, brand new template such as 'No Template - Imperial.' Assign a coordinate system to modelspace, e.g. MA83F, Massachusetts State Plane US feet. For your points, start with an appropriately formatted csv file, e.g. PENZD. (You may also select any other properly formatted csv file available in the 'select formatting' dropdown section of the MAPIMPORT command.)

 

This video shows a how you can import lat/long points from a csv file into a map using Massachusetts State Plane CS feet. The csv file is formatted as PENZD. After the points are imported, Bing aerial imagery is turned on to illustrate how a projected CS and a geographic CS, MA83F and LL84 respectively, are able to harmonize with one another and georeference the points (telephone poles) along the streets.

  

 

Chicagolooper

EESignature

0 Likes
Message 4 of 23

Anonymous
Not applicable

When I try to import the .csv file nothing shows up. I attempted to replicate your example exactly but no results appear in the preview section. I notice you are using AutoCAD Civil 3D, is it possible I don't retreive the same results since I'm using AutoCAD Map 3D 2016?

0 Likes
Message 5 of 23

АлексЮстасу
Advisor
Advisor

_MAPIMPORT is a Map 3D command, not Civil. In 2016, the same import (and export) as in other versions.
Civil has its own points import, including latitude/longitude in degrees, minutes, seconds. But in the import of Civil it will not be possible to create Object Data for points to load description data into them.

 

Most likely you did not use commas or spaces to separate the data, as advised by ChicagoLooper. Or did not translate latitude/longitude into decimal degrees.
But we can understand the problem better if you attach a file with points or at least a few lines of it.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes
Message 6 of 23

ChicagoLooper
Mentor
Mentor

If you don’t get a ‘preview’ then you  either don’t have a properly formatted csv file or you haven’t chosen the appropriate file format type. 

 

The most common reason for an improperly formatted csv file is column headings in row 1 of your csv. Delete row 1 then try again. 

 

TIP: Create your csv By using Excel, not Notepad. Separate the data using columns, not commas, and enter only one point per ‘row.’ When you’re done, perform a SAVE AS while still on Excel using .csv (comma delimited) as extension or file type, don’t save as an xlsx. 

Chicagolooper

EESignature

0 Likes
Message 7 of 23

Anonymous
Not applicable

Thanks for the help! I was able to plot points and it lines up exactly to the map. I have one more thing to figure out. So now I need to overlay the points to a spatial design. The only issue is that the spatial design has a pre-set Coordinate Reference System (UTM83-16F). I wonder if I can change either coordinate system so that both the map and the coordinate points match up.

0 Likes
Message 8 of 23

ChicagoLooper
Mentor
Mentor
Accepted solution

Yes, you can. If the points in your csv file are listed in Lat/Long coordinates then you can, and must, indicate LL84 (or the applicable geographic CoordSys) while your modelspace is assigned UTM83-16F.

 

You will use MAPIMPORT command to bring in your points. Browse to your csv file and be sure to change 'Files of Type' to ASCII Point File (*.txt, *.csv, *.asc, *.nez) then click OK.

 

The settings in 'Import ASCII Points' will look like this:

 

MAPIMPORT command=>Import ASCII Points dialog box.MAPIMPORT command=>Import ASCII Points dialog box.

 

After importing your points, select all of the points and change the Scale X, Scale Y, and Scale Z in the properties palette so the points will have an appropriate size, not too big and not too small.

Chicagolooper

EESignature

0 Likes
Message 9 of 23

Anonymous
Not applicable

That settled it! Thanks again!

0 Likes
Message 10 of 23

ENGMA1234
Explorer
Explorer

-MAPIMPORT how can I set filetype in command bar to google kml (*.kml,*.kmz)

@АлексЮстасу @ChicagoLooper @Anonymous 

0 Likes
Message 11 of 23

ChicagoLooper
Mentor
Mentor

@ENGMA1234 wrote

<<....-MAPIMPORT  how can I set filetype in command bar to google kmL....>

 

Google Earth Pro uses LL84 (also known as WGS84 EPSG 4326). If you want to import a kml file to modelspace must first assign a coordinate system to your drawing. If you don't assign one, or you assign one that's not appropriate to your area, then the objects you import won't geolocate to the right spot.

1. MAPCSASSIGN to assign a coordinate system to your modelspace.1. MAPCSASSIGN to assign a coordinate system to your modelspace.

 

Once you've assign your coordinate system, you may use MAPIMPORT command.

 

When executing the MapImport command change the 'File type' to kml.

2. Use MAPIMPORT to import kml or kmz files.2. Use MAPIMPORT to import kml or kmz files.

Chicagolooper

EESignature

0 Likes
Message 12 of 23

ENGMA1234
Explorer
Explorer

@ChicagoLooper Thank you for helping but I want use filedia 0 ....  -mapimport I dont want using dialogbox , I have trouble to set filetype in command bar

0 Likes
Message 13 of 23

АлексЮстасу
Advisor
Advisor

OGCKML - ?


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes
Message 14 of 23

A_HULL-2021
Explorer
Explorer

I'm having the opposite issue, where I want to export with real long-lat values but only get the arbitrary CAD coordinates. Any ideas?

0 Likes
Message 15 of 23

Pointdump
Consultant
Consultant

Hi Archie,
More details please. Do you want to export a geo-referenced drawing or a shapefile? Posting your drawing would help.
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2025
0 Likes
Message 16 of 23

A_HULL-2021
Explorer
Explorer

Hi Dave,
I am hoping to export a geo-referenced file that I can load into an open street map, either shaper file to geojson or something similar.

A_HULL2021_0-1764080275556.pngThe file contains line data with text, layered over a geo-referenced open street map.

 

0 Likes
Message 17 of 23

ChicagoLooper
Mentor
Mentor

@A_HULL-2021 

<< I want to export with real long-lat values but only get the arbitrary CAD coordinates. >>

 

To export Lat/Longs from your drawing, or any drawing, you must first establish a georeference in modelspace. This involves 'assigning' a Coordinate System (CS) to your drawing. There are several ways to do this, some are easy, some are hard. Regardless of which way you choose, you should have a rudimentary understanding of both the GEOGRAPHIC and PROJECTED types of coordinate systems.

 

Without a background in coordinate geometry you may run into a lot of 'But if I do this' and 'I read by doing this' and 'I was told to do this' and 'This is how I normally do it' any of which might cause your efforts to fail.

 

Both AutoCAD Map3D and Civil3D make it easy to assign a CS compared to plain vanilla Cad. If you don't run M3D or C3D, you're already starting at a disadvantage.

 

Make no mistake, once you've assigned a proper CS, you can pull out the Lat/Longs. Without an assigned CS Lat/Longs cannot, and do not, exist.

 

Also be aware that objects such as Points, Lines and Polygons must be positioned, or georeferenced, accurately in modelspace once your CS has been assigned. It might be better to assign a CS first then begin to draw from scratch. Or you may need to move, scale, and rotate your existing objects so they are truly georeferenced against the CS you've just assigned.

 

With a CS, your modelspace will have a virtual equator and north pole. If your objects are accurately georef'd then the Lat/Longs you pull out will be good. But, if your objects are in the middle of the ocean after assigning the CS, then your objects are not georef'd properly. And that means even if you pull out the Lat/Longs, those coordinates will position your objects in the ocean and not on dry land.

 

Would it be possible to upload your drawing? Or five objects from the outer edges of your site? The Forum can diagnose your drawing and determine whether the objects are georeferenced to begin with and also provide examples of a CS you can assign to modelspace. Once you've assigned an appropriate CS, the Forum can also explain how you can pull out the Lat/Long. There are too many variables to provide an answer to your question, way, waaay too many.

 

Uploading your actual drawing will be faster. Also disclose your AutoCAD version and the year of release.  

Chicagolooper

EESignature

0 Likes
Message 18 of 23

A_HULL-2021
Explorer
Explorer

Hi ChicagoLooper,
I believe my file is correctly geo-referenced, as the annotations are overlaying a bing openstreetmap generated from a reference point. I have tried using vanilla and map3d. I can switch between "Geographic" and "Precise" coordinates, but can only seem to export the arbitrary CAD coordinates.
Expected: X = 53.9122, Y = -0.1618
Actual:      X = 564555108.8295 Y = 432344676.6551
I've tried different CRS too, but can't seem to export it right. 
I will need to check if I'm able to share the .dwg, as it contains sensitive info.
Is there a way for me to check if all lines have been geo-referenced, or to ensure that they are?
Using latest versions of both software, fresh installs.
Apologies for the ambiguity.
Cheers

0 Likes
Message 19 of 23

ChicagoLooper
Mentor
Mentor

@A_HULL-2021 wrote

<<the annotations are overlaying a bing openstreetmap generated from a reference point. >>

 

That last part might be your problem because you don't know whether that reference point is a valid point in the real world. Sure, it may be valid in 'your drawing' but that doesn't necessarily mean that specific reference point has the exact same coordinates as the real-deal location on planet Earth.

 

If you believe drawing is accurate, then try this:

  1. Open a brand new, clean drawing and assign your coordinate system. (This should be the same CS that's assigned used in the original drawing. If you didn't assign a CS in the original drawing then this procedure might won't work. And if you assigned the wrong CS then it definitely won't work. If you're guessing on the correct CS used in the original, then you must guess accurately. Keep this drawing open, don't close it.
  2. Go back to the original drawing and select ALL objects=>right click=>Clipboard=>Copy with Base Point=>go to command line 0,0 Enter key
  3. Go back to the brand new, clean drawing=>right click a blank area in modelspace=>Clipboard=>Paste=>go to command line 0,0 Enter key
  4. Zoom Extents. 
  5. While still  in the new drawing, go to Geolocation Tab=>Online Map Panel=>change Map Off the Bing Hybrid

Your pasted objects should now appear in modelspace with Bing aerial map in the background. If Bing aerial map is NOT consistent with your line work then your original drawing isn't georeferenced correctly. Or the CS assigned to the original drawing is not correct and all objects must be properly geo-ref'd. Or the original has no geo-reference at all which means your original drawing is arbitrarily drawn in modelspace despite the text overlaying with openstreetmap. Whatever the issue(s), you won't be able to pull out Lat/Longs unless you move, scale, and rotate your objects in your new drawing to match Bing imagery.   

 

Eventually, when you export (if you export properly, MapExport command can get tricky, very tricky) export with the projection known as WGS84 datum, EPSG 4326. This doesn't mean you need to assign WGS84 EPSG 4326 to modelspace, it merely means when you export, you are forcing the exported objects to have the WGS84 projection. Contrary to what's on the internet or in various Forums, you can assign coordinate system A to modelspace then export objects to coordinate system B. Coordinate system B will be WGS84 EPSG 4326 and coordinate system A can be whatever you or your colleagues decide to assign to the modelspace environment. This works in Map3D and Civil3D because both programs have geospatial capabilities to perform Coordinate Transformations.   

 

Important takeaways:

  1. Your Cad drawing must have a valid coordinate system (CS) assigned and your lines, points, and polygon must be drawn accurately in that geo-referenced environment.
  2. You must properly export to a CS that can be read by Bing or whatever other program you send the linework to. Both proper exporting AND proper projection is mandatory. 

 

Chicagolooper

EESignature

0 Likes
Message 20 of 23

A_HULL-2021
Explorer
Explorer

Really appreciate your reply, I've tried exporting with the WGS84 EPSG4326 as you described, and have also tried to change/reproject the original CRS to the same, but didn't get the expected coords on export. I'm out of the office at the moment but will try the verification steps you have suggested and report back. 

All the best.

0 Likes