Data table - Adding calculation columns for X,Y as latitude and longitude

Data table - Adding calculation columns for X,Y as latitude and longitude

toolbox2
Advocate Advocate
2,015 Views
14 Replies
Message 1 of 15

Data table - Adding calculation columns for X,Y as latitude and longitude

toolbox2
Advocate
Advocate

I have an SDF source containing points. In the Data Table, I have added calculation columns to give me X and Y coordinates of the points. This is giving me Easting and Northing values. I need Latitude and Longitude values so I followed this advice :

https://knowledge.autodesk.com/support/autocad-map-3d/troubleshooting/caas/sfdcarticles/sfdcarticles...

 

In a new drawing, I set my coordinate system to LL84 and duly added the X and Y columns but they still display Easting and Northings?

 

What am I doing wrong?

 

Hope someone can help.

0 Likes
2,016 Views
14 Replies
Replies (14)
Message 2 of 15

Pointdump
Consultant
Consultant

Can you post your SDF? (Might need to Zip.)
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 3 of 15

toolbox2
Advocate
Advocate

I can't with the working file but I have created a dummy SDF and added 2 features within it.

 

I note that a coordinate system is applied to the SDF at the time of creation. I also can see that this can be overridden in the Data Connect palette. Anyway, the attached file has been created using LL84.

 

0 Likes
Message 4 of 15

ChicagoLooper
Mentor
Mentor

There's more than on way to get the Lat/Long coordinates from the x,y's. To help you with a workflow, you'll need to provide a little more background. Giving you all possible solutions is not an efficient way for you to resolve your problem. Please explain:.

 

  1. What is the current coordinate system of the drawing hosting your points,e.g. State Plane, UTM, or something else? (If your drawing doesn't have an assigned coordinate system, then you'll need to georeference your drawing before any solution can be formulated.) 
  2. Do you need a written list of Lat/Longs, e.g. an xlsx, csv or something else?
  3. Waht is the purpose of acquiring Lat/Longs. Are you 'feeding' a list of the lat/longs into another program? What program? Explaining why you need lat/longs will go a long way in providing a workable procedure with step-by-step instructions. 

 

Chicagolooper

EESignature

0 Likes
Message 5 of 15

Pointdump
Consultant
Consultant

@toolbox2,
I've not done this in Map before, so I thought I'd try out from instructions in your link.
I brought in a Shapefile. It already had Lats and Longs so I called the new columns "Lat_Calc" and "Long_Calc".
I'll try it now with your SDF.

 

Create_Calc.png

 

Create_Calc_2.png

 


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 6 of 15

Pointdump
Consultant
Consultant

@toolbox2,
OK, I tried it just now with your SDF. Big problem is with the Coordinates. Those are definitely NOT Lats and Longs. As for how to fix things, I don't know.

 

Create_Calc_3.png

 


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 7 of 15

toolbox2
Advocate
Advocate

Good point.

 

I want to upload some points from my SDF to a Google map that I'm creating. Google needs a CSV, XLSX, KML or GPX file. I can create a CSV file from the Data Table palette. I need to include columns for latitude and longitude.

 

I don't normally have to work with coordinate systems unless I need to achieve something - like now. If I have to apply a CS at all then it would normally be the OSGB British National Grid (Eastings and Northings).

 

If I apply an alternative Lat Long CS to my drawing then the points in the SDF source do appear to be on Lat Long coordinates. It's just that the calculation columns in the Data Table still produce Easting & Northings.

 

 

 

0 Likes
Message 8 of 15

ChicagoLooper
Mentor
Mentor

If your goal is to simply put your points into Google  Earth Pro, then you do not need to create ‘calculation columns’ in the SDF table. Map3D is fully capable of exporting your SDF formatted points into another format GE Pro understands. The newly exported file can then be opened using GE Pro (actually ‘imported’ by GE Pro) and your points will appear accurately on the Google map.    

<<The user, that’s you, doesn’t have to calculate and view those two extra columns in the SDF’s table in order for export to occur. All mathematical calculations occur behind the scenes.>>

The key to all this is to make sure your SDF points are geospatially accurate. First, open a brand new, clean metric template and assign an appropriate projected coordinate system. Next , bring in your SDF points using a Data Connection then turn on Bing Hybrid Maps so aerial imagery appears as a basemap. If the points look correctly positioned against the aerial photo background, you’re good.

 

<<If the points don’t appear geospatially accurate, then something’s wrong and you’ll need to investigate and take corrective action, up to and including, a total re-do of the points.>>

If your SDF points are geospatially accurate, turn off (uncheck) the point layer in the Map Task Pane. Next, use MAPIMPORT command and import your SDF points into this new drawing. The Mapimport command will convert the points from SDF entities into AutoCad point entities. At this point you'll have the points sitting in modelspace in two different fomats: (A) AutoCad point objects and (B) SDF feature data objects (although the SDF entities are not currently visible b/c you have turned them OFF in the Map Task Pane).

 

<<If your imported points are not easily seen, use PTYPE command and change the point style. You may change from the default '.' dot style to another, e.g. the style that looks like a circle with an X.>>

 

Next you will use MAPEXPORT command to export the AutoCAD points to shapefile. If your soon-to-be exported points are sitting in drawing currently referenced to OSGB British National Grid Meters, then the MAPEXPORT command will also allow you transform the SDF’s georeference from OSGB to WGS84 Lat/Long or the coordinate system used and understood by GE Pro. 

<<By default, the MapExport command, will adopt the current drawings's coordinate system and use it to create the shapefile's prj file. Howver, you have the option to not adopt the current drawings CS and use a an alternate CS selected by you. This is conversion, from one CS to another, is performed on the 3rd Tab of the MapExport procedure. Simply select WGS84 (aka LL84) using the Coordinate System Library button, it looks like a globe, then check the box named Convert coordinates to. Don't forget, you'll still need to complete the 1st and 2nd tabs of the MapExport command.>>

 

Finally, from GE Pro go to File=>Import=>change files of type to '.shp'=Browse to and select your newly created shapefile=>Open.

 

Optional: Once the shapefile is mported perform a SAVE AS and save the point file as a kmz or kml. If you wish, you may email the kmz/kml to a colleague in another office. In the end you’ll not only have your points in its original SDF format but you’ll also them in shapefile and kmz/kml too. Those extra columns you originally wanted to add, can be, and should be, totally avoided. 

Chicagolooper

EESignature

Message 9 of 15

toolbox2
Advocate
Advocate

Well, that pointed me in the right direction although I am using Google Maps, not Google Earth so SHP file are out of the question. After a few extra steps I managed to do what I needed to do, so thanks for your input.

 

However, I have another task where I need to again extract lat/long coords and other data from the SDF to an Excel or CSV file. So, the question remains - how do I get lat/long coordinates from an SDF that was evidently created using a different coord system?

 

My method now is to :

  1. Attach my SDF to a drawing assigned to LL84.
  2. Export my layer to a temporary SDF.
  3. Attach temporary SDF to a new drawing (which doesn't have to be set to LL84).
  4. Add calculation columns.
  5. Use the Export tool in the Data Table to export a CSV file which is exactly what I need.

That's not too painful, but is it possible to achieve this within AutoCAD Map without the creation of the extra SDF files? Somehow translate the coord system from one to another? The Data Connect palette looked hopeful - it's possible to change the coord system there but it still wouldn't produce lat/long in the Data Table calculation columns.

Message 10 of 15

Pointdump
Consultant
Consultant

@toolbox2,
"...is it possible to achieve this within AutoCAD Map without the creation of the extra SDF files?"
1. MAPCONNECT your SDF to a drawing assigned LL84.
2. Open Data Table.
3. Create a Calculation. 2 actually.
4. Save.

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
Message 11 of 15

ChicagoLooper
Mentor
Mentor

Huh? Out of the question?

 

Google Earth Pro used to be a subscription but now it’s FREE. (Use your favorite search engine to find the download link.) You are hindering your productivity by using Google Maps. 

Chicagolooper

EESignature

0 Likes
Message 12 of 15

toolbox2
Advocate
Advocate

That's the problem. The calculation columns continue to use the coordinate system that the SDF file was created under even though I have set the CS in the current drawing to LL84.

 

Creating the intermediate SDF enables me to correctly obtain lat/long. I was hoping there's a way of doing it that is self-contained within the current drawing and using the original SDF.

0 Likes
Message 13 of 15

toolbox2
Advocate
Advocate

Ah, thanks for the heads up on that!

0 Likes
Message 14 of 15

parkr4st
Advisor
Advisor

mapimport you data and save it in the cs of the data

new map  set cs  to LL

attach the dwg of your original data onmap explore tab of TASK PANE

Query it into the map with LOCATION:ALL

mapexport the data select attributes x1 and y1 from properties list to a new sdf

x1 and y1 are long and lat.

0 Likes
Message 15 of 15

ChicagoLooper
Mentor
Mentor

@toolbox2 wrote:

<<Creating the intermediate SDF enables me to correctly obtain lat/long.>> 


I am guessing, where is your site, Bristol?

 

I don't think you are obtaining Lat/Longs. As @Pointdump  has aleady mentioned, the TestLL.zip you uploaded in post #3 is not referenced against WGS84. If it were, they would  use units of degrees, not meters.

 

It's easy to see your SDF was created by someone who's inexperienced. Would it be possible to upload your DATA so the the SDF can be properly created?

 

You are desperately clinging to the idea of  calculating Lat/Longs to solve your problem. That's an ineffective workflow being used on a badly created SDF. (I'd avoid creating calculations in the Data Table. If you know how, you can harvest  Lat/Longs from within Map3D.) Start by creating and using an accurate SDF to begin with and you won't have to formulate any calculations. 

Chicagolooper

EESignature

0 Likes