Turn an xym linestring into an xyzm linestring

2120
5
12-05-2017 10:30 AM
PhilHardy
New Contributor II

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
Occasional Contributor

Is the data in a database?

0 Kudos
deleted-user-UxcAu2PHrDQp
Occasional Contributor

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

0 Kudos
PhilHardy
New Contributor II

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
Occasional Contributor

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
New Contributor II

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