Select to view content in your preferred language

XY coordinates using SQL command

6066
7
Jump to solution
05-20-2014 02:54 AM
User35489
Frequent Contributor
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
0 Kudos
1 Solution

Accepted Solutions
AsrujitSengupta
Deactivated User
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

0 Kudos
7 Replies
VinceAngelo
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
0 Kudos
User35489
Frequent Contributor
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
0 Kudos
VinceAngelo
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
0 Kudos
User35489
Frequent Contributor
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
0 Kudos
AsrujitSengupta
Deactivated User
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.
0 Kudos
VinceAngelo
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
0 Kudos
User35489
Frequent Contributor
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
0 Kudos