Querying DB directly for shape and creating geometry
I was looking for a work-around to publishing a map layer.
I was hoping to use the SQL query activity to get back a polygon geometry and be able to use that geometry to construct a feature. It's easy enough to do with points, but with a polygon with multiple coordinate pairs I was struggling.
It does not seem like I can call for the shape (sql server geometry type) in my SQL query activity and convert those results from data table to a feature. They have me an error:
System.InvalidOperationException: DataReader.GetFieldType(7) returned null.
I was also thinking I could use the geometry method STasText and parse that into a set geometry activity, but alas I wasn't sure how to convert that. example geometry.STasText() below
this one is using spatial ref 2913
POLYGON ((7667761.6433727 666312.76738844812, 7667776.0101706088 666312.46587926149, 7667775.8841863573 666306.46719160676, 7667795.259842515 666306.06069554389, 7667795.59547244 666322.05708661675, 7667791.5964566916 666322.14107611775, 7667791.8480971158 666334.13845144212, 7667762.3546587974 666334.75721785426, 7667761.6433727 666312.76738844812))
If anyone has a tip, I'd sure appreciate it!
-Jake Brown
City of Portland, OR
-
Hi @Jake Brown? - did you ever figure this one out? Looking to do something similar. Thanks!
0 -
Hello @Hilary Bar? I took that conversation offline with @Amanda Frech? and she was able to provide a working example. I've attached. Hope that helps!
-Jake Brown
City of Portland, OR
0 -
Thank you, @Jake Brown? and @Amanda Frech? !
0 -
Dear Jake,
Can you please re-attach the workflow?
Thank you,
0 -
Hello,
Is this workflow still floating around somewhere by chance? I would really like to implement this.1
Please sign in to leave a comment.
Comments
5 comments