AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

exporting to SQL

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
Anonymous
1268 Views, 13 Replies

exporting to SQL

Hello,

 

I've uploaded a file to a SQL database server. I'm trying to figure out how to get each individual vertex of a polygon to show up as it's on column. I thought the Geometry column would have had it, but it gave us giberish.

 

 

SQL HELP.PNG

 

 

 

I need something that shows this type of data:

 

vertex.PNG

all the vertices' x and y coordinates.

 

Thanks in advance.

 

 

13 REPLIES 13
Message 2 of 14
Anonymous
in reply to: Anonymous

I think the data is in Hexadecimal but I want it in decimal if that helps.

Message 3 of 14
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

>> how to get each individual vertex of a polygon to show up as it's on column

Try to imagine how long you might scroll to the right, if a polygon consists of 100.000 vertices, which means then 300.000 columns for each vertexX/Y/Z.

So the answer, sorry, is no, not with Map 3D.

 

You might get it done with some SQL-Server tools, the question is then what you want to do with that mass of columns.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 4 of 14
Anonymous
in reply to: Anonymous

I spoke to the guys at my office who use the data from SQL. It doesn't need to be in individual columns, but it does need to display as decimal data instead of Hex. In other words, it needs to look like the Lats and Longs that the gibberish represents.
Message 5 of 14
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

>> it does need to display as decimal data

Well. the difference is then instead of 300.000 columns you'll get 100+ A4 pages of coordinates.

May I again ask whatfor is this needed, what should be done with that data, maybe we find a way to get that working, but we need to know what and how the data is then used!

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 6 of 14
Anonymous
in reply to: Alfred.NESWADBA

see the attached .shp files. the vertices i want shown are for each individual item in each layer. You can see the example of the individual objects in the The building shp file.

 

SQL HELP2.PNG

 

The IT group uses the SQL file exported from outocad to build boundries in another piece of software. The original method we used, before Map 3d, had the lat/long for each point separated by commas in the geometry column. Whether 3 or 300 data points in the column is no issue. The Hex string is pretty long already. I hope this helps

Message 7 of 14
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

>> the vertices i want shown are for each individual item in each layer

Sorry, that is one vertex from many of the polygon. Is it necessary to know which vertex should be used for lat long?

You might import the SHP using _MAPIMPORT and then run command _MAPEXPORT and as definition for output attributes you can select (within "Properties") the values for X1 and Y1, this creates two columns in the exported SHP or SDF with the startvertex of the polyline.

 

20160519_1507.png

 

I'm guessing and guessing why that is needed, I have no idea ... especially in case the polygon is modified who remembers to take care about updating these two values, it's reduntant info 😉

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 8 of 14
Anonymous
in reply to: Alfred.NESWADBA

I was able to get those values in my latitude and longitude columns on SQL by doing that process. However, I don't believe the geometry column is giving me just one point. looking at my other tables which i know have more points than the one I put on here, the line strings are longer. I can only surmise that the hex string is giving me all my points.

Message 9 of 14
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

>> However, I don't believe the geometry column is giving me just one point

You are correct, the geom or geometry column hold all vertices,

But you have shown a sample with the info "that's what you are looking for" (at least I understood it that way) and I showed you how to create the columns "lat" and "long" which was requested.

 

If you need all vertices of a polygon then:

  • AutoCAD Map 3D does not support that with any function out of the box
  • MS-SQL Server may have a function to get that info's, but I don't know any.
  • An important question is open: what will you do with 100+ A4 pages of coordinates ... that answer might bring us to tools (or writing a tool) that fits to your needs, as I don't understand what will happen then I can't do anything more to support you. Knowing whatfor that is needed might bring up ideas (or a tool).

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 10 of 14
Anonymous
in reply to: Anonymous

I appreciate your help. It usually takes me a while to ask the question in the right way 😋. The software this map is used for is to create GPS tracking for trailer parking as well as the buildings and perimeter for the job site. From what I've been told by the software developers, it needs X Y coordinates instead of the Hex string. I'm thinking along the same lines as you that it's more of an SQL issue. I'm just wondering if there might be a setting in Map 3D that would break the string up into it's individual coordinates.
Message 11 of 14
Alfred.NESWADBA
in reply to: Anonymous

Hi,

 

ah, ok, I guess that is better done in SQL-Server, e.g. described >>>here<<< ... does that solve your needs?

Map 3D can't do that, or you want to write some tool to do that, this is nothing very complex, just need to be done if the above suggestion is not a possible workflow/solution.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 12 of 14
Anonymous
in reply to: Alfred.NESWADBA

that SQL file is a really good start. only problem is it takes data from text typed in instead of from the line string. I have no experience with SQL other than what I've been messing with the last couple of days, so I wouldn't know where to begin modifiying this code to make it read the string.

Message 13 of 14
Gary_Braun
in reply to: Anonymous

I haven't tried this yet myself, but one possible workflow would be...

 

1) Attach your SQL table using FDO and add the features to your drawing

2) Use MAPEXTRACTFEATUREGEOMETRY to bring them into your drawing as MPolygons (you may need to explode them to closed polylines afterwards, but I'm not sure, so you could try it both ways)

3) Save and close drawing

4) Open new blank drawing and attach the one you just closed

5) Run a report query to get the X1,Y1,Z1 vertices for your polygons -- make sure to process sub-objects to get them all

 

It's a bit of a work-around but it might just give you what you want.

Message 14 of 14
Anonymous
in reply to: Anonymous

So my IT buddy came over after doing some research and this is the solution:

 

simply add .STAsText() next to geometry in the SQL file and it will spit out the lat long coordinates for each polygon. I was expecting gobs of code, but thats it.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


AutoCAD Beta