XY coordinates using SQL command

3118
7
Jump to solution
05-20-2014 02:54 AM
Highlighted
Occasional Contributor II
Hello There,

Please let me know how to extract the X and Y coordinates from a Feature. Although, we can get it using ArcMAP, but i need it using SQL.

Thanks
-AS
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor III
I think this should get you the desired X and Y coordinates of the vertices of a feature:

ST_AsText
http://resources.arcgis.com/en/help/main/10.2/index.html#/ST_AsText/006z0000003v000000/

Example:
-----------
SELECT OBJECTID, sde.st_astext (SHAPE) SHAPE FROM featureclass_name;
----------

You need to have ST-geometry configured for that Oracle database to use the above query.

View solution in original post

Reply
0 Kudos
7 Replies
Highlighted
Esri Esteemed Contributor
You'll need to provide more information, including:

  • The RDBMS you are using

  • The geometry storage format

  • The topology class of the features (point/line/polygon)


Note that not everyone on this forum self-identifies as a "geek", so your
greeting might be considered offensive to some.  I suggest you stick to
less charged terms when requesting help from folks.

- V
Reply
0 Kudos
Highlighted
Occasional Contributor II
Thanks Vince for correction,

ORACLE 11g R2, ST_Geometry and Polygon feature class.

Best Regards
-AS

You'll need to provide more information, including:

  • The RDBMS you are using

  • The geometry storage format

  • The topology class of the features (point/line/polygon)


Note that not everyone on this forum self-identifies as a "geek", so your
greeting might be considered offensive to some.  I suggest you stick to
less charged terms when requesting help from folks.

- V
Reply
0 Kudos
Highlighted
Esri Esteemed Contributor
Polygons have at least 3 unique vertices and a centroid -- Which X,Y value are you
trying to extract? Or do you want them all? And what are you planning to do with
it/them once you have it/them?

- V
Reply
0 Kudos
Highlighted
Occasional Contributor II
Vince,
We are looking for all.

Thanks
-AS

Polygons have at least 3 unique vertices and a centroid -- Which X,Y value are you
trying to extract? Or do you want them all? And what are you planning to do with
it/them once you have it/them?

- V
Reply
0 Kudos
Highlighted
Regular Contributor III
I think this should get you the desired X and Y coordinates of the vertices of a feature:

ST_AsText
http://resources.arcgis.com/en/help/main/10.2/index.html#/ST_AsText/006z0000003v000000/

Example:
-----------
SELECT OBJECTID, sde.st_astext (SHAPE) SHAPE FROM featureclass_name;
----------

You need to have ST-geometry configured for that Oracle database to use the above query.

View solution in original post

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor
It might be easier to use ST_PointN to fetch individual points inside PL/SQL
(instead of text processing on a CLOB), which is why I asked what you were
planning to do with them.

- V
Reply
0 Kudos
Highlighted
Occasional Contributor II
Thanks for your input Vince.
I will try ST_Point also to see the result.

-AS
It might be easier to use ST_PointN to fetch individual points inside PL/SQL
(instead of text processing on a CLOB), which is why I asked what you were
planning to do with them.

- V
Reply
0 Kudos