MapInfo Discover 3D: how to keep z coordinate of polygon points imported from csv-file?

158 views
Skip to first unread message

Евгений Матвейчев

unread,
May 16, 2017, 5:17:17 AM5/16/17
to MapInfo-L

Hello!

 

I have a problem with import of polygon objects from csv-file into Discover 3D. Here are the details:

 

1)     I need to create polygon objects programmatically, setting coordinates of points manually. So, I calculate the coordinates and create csv file the way MapInfo Discover does:

 

ObjNo,ObjType,X,Y,Z,"FeatureID","Name","XCentre","YCentre","ZCentre","Value","Colour","Description","Type","Length","Area","Volume"

3,POLYGON,-13628.759765625,8781.1298828125,0.7666015625,3,"Polyhedrion_3",0,0,0,0,0,,"Polygon",0,0,0,

3,POLYGON,-13629.4296875,8783.6298828125,3057.7666015625,3,"Polyhedrion_3",0,0,0,0,0,,"Polygon",0,0,0,

3,POLYGON,-13631.259765625,8785.4599609375,5057.7666015625,3,"Polyhedrion_3",0,0,0,0,0,,"Polygon",0,0,0,

3,POLYGON,-13628.759765625,8781.1298828125,0.7666015625,3,"Polyhedrion_3",0,0,0,0,0,,"Polygon",0,0,0,

 

2)     Then, I import data into my MapInfo Discover project (via Discover/File -> Import -> ASCII Import). It’s something like this:

 

 

3)     In Modify Tab I use Object Builder to build polygons from these points:



 

 

After that I get new .tab file, which has the following data:

 

 

 

As we can see, an object now has only one Z coordinate, there are no more information about polygons vertices.

 

Could you explain me, please, where I can see that information and how I can change it?

The problem is: when I import that .tab information into MapInfo Discover 3D Feature database, there is only one z coordinate for all vertexes of polygon (the same as indicated in the table above: 0,766602). Is there any way to keep original z coordinates for all vertexes of polygons as described in my .csv file?

 

So, when I import my .tab file into the feature database, my polygon is parallel to z axis now =( :

 

 

 

 


By double clicking the row, I can see coordinates. Z coordinate is equal for all polygons vertices:

 

 

Version of program: MapInfo Discover 16.0 (64 bit) release build 26,

Operating System: Windows 8 x64

 

 

Thank you in advance!

Have a nice day!

AlexZ

unread,
May 16, 2017, 11:23:16 PM5/16/17
to MapInfo-L
Hi!

Ok, firstly part of your issue is that MapInfo Pro does not store attributes for individual nodes within a polygon. So as soon as you converted your XYZ coordinates into a polygon, MapInfo Pro lost the individual Z values, and only assigns an XY for the centrepoint of the polygon.

Secondly, the shape/s you are creating are not necessarily (in fact unlikely) to be polygons in 3D, but surfaces (there is no guarantee that the nodes making up your shape will be co-planar).


So the solution:

1/. Import your nodes into MapInfo Pro 2D, and create a TAB file, with XYZ coords for each node.

2/. Move these nodes directly into 3D. Within the Discover 3D window, Features>Import, select your new TAB file of points, and in step of the the import wizard, ensure your assign the Z value for each node from it's Z field ("Initialize the Z value from a attribute")

3/. Make the new feature database containing your nodes selectable and editable. 

4/. Enable the Polygon Select tool:




5/. Draw selection polygon around all the nodes representing your first object




6/. Select the Triangulate tool:



7/. Voila!




I hope that helps?

Alex Zdziarski
Product Manager
Pitney Bowes

Евгений Матвейчев

unread,
May 17, 2017, 1:49:42 AM5/17/17
to MapInfo-L
Hi, AlexZ!

Thank you very much for your answer! 

I have just tried it, and for some tasks, it definitely works well. Nice advice, thanks!


However, I forgot to mention that all this process should be able to be done automatically: we have hundreds of such figures and we are searching for the way to import them as separate objects (as we did using Object Builder).  

By selecting all those points and using Triangulate, I get one huge object like this (instead, I want to get many separate small objects):



 

Is it possible to complete this task using .dxf or other vector formats, which can be modified programmatically outside MapInfo products (or using MapBasic as well)?


вторник, 16 мая 2017 г., 15:17:17 UTC+6 пользователь Евгений Матвейчев написал:

AlexZ

unread,
May 17, 2017, 7:51:06 PM5/17/17
to MapInfo-L
Sorry, there is no way of doing this automatically within MapInfo Discover 3D. You can only select each group of points representing a single object, and triangulate that (select graphically as discussed, or possibly as a Feature Query based on an attribute field).



Regards

Alex Zdziarski
Product Manager
Pitney Bowes.

Евгений Матвейчев

unread,
May 22, 2017, 6:05:44 AM5/22/17
to MapInfo-L
Thank you for your help!

I've found a solution: I create those figures in .dxf using netDxf library, then import them directly into Discover 3D via Features/Import -> Vector Files.
Then I get separate polygon objects with different Z coordinates for each vertex in my Discover 3D View.


четверг, 18 мая 2017 г., 5:51:06 UTC+6 пользователь AlexZ написал:

AlexZ

unread,
May 22, 2017, 7:29:38 PM5/22/17
to MapInfo-L

Great to hear!
Reply all
Reply to author
Forward
0 new messages