Select to view content in your preferred language

Turn an xym linestring into an xyzm linestring

2509
5
12-05-2017 10:30 AM
PhilHardy
Occasional Contributor

I have a feature class with xym linestring geometry.  I need it converted to xyzm linestring geometry (with z set to 0).  How can I do this?

0 Kudos
5 Replies
deleted-user-UxcAu2PHrDQp
Deactivated User

Is the data in a database?

0 Kudos
deleted-user-UxcAu2PHrDQp
Deactivated User

Also if it is in an Oracle database ESRI ST, Oracle ST or Oracle SDO geometry type

0 Kudos
PhilHardy
Occasional Contributor

Hey Eric.  The data is in an FGDB getting prepped to go into postgres.  I wrote a function in Oracle SDO to do this conversion but I don't know how to do it in either ArcGIS or Postgres.  The workaround I am using now is copying the table to Oracle, converting it, copying it back to Esri, then copying it to postgres.  It is pretty ugly.

0 Kudos
deleted-user-UxcAu2PHrDQp
Deactivated User

Yea, I figured you were doing that.  I looked through the SQL API Here but nothing stuck out at me.  Thought about ST_GeomFromText in an SDE environment

"When you provide a well-known text description to construct a geometry, the measure coordinate must be specified last. For example, if your text includes coordinates for x, y, z, and m, they must be provided in that order, not x, y, m, z."

But that is not your case.  Guess this has beaten the Database guys.  We would use FME to do the conversion.

0 Kudos
PhilipHardy
Emerging Contributor

I did find a solution that did what I needed.  I converted the XYM shapefile to an XYZM shapefile using this. I used the Feature Class to Shapefile tool in ArcGIS and selected the Environments button and set it to enable Z with a default of 0. The resultant shapefile has XYZM geometry.  I am sure the Environments button will work similarly with other commands as well.

PhilipHardy_0-1674846560505.png