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.
I need something that shows this type of data:
all the vertices' x and y coordinates.
Thanks in advance.
Solved! Go to Solution.
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 -
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 -
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.
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
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.
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 -
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.
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:
- alfred -
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 -
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.
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.
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.