Create my own WKT

1626
6
Jump to solution
09-16-2013 10:57 PM
JoeHewitt
New Contributor III
Hello,

Is it possible to create my own Well Known Text (WKT) for a coordinate system that is not registered with a WKID.

I am wanting to print into my own spatial reference so would be passing this WKT into

<esri:PrintParamters outSpatialReference="{new SpatialReference(WKT)}"

I cant seem to test this idea, because I get errors when I try test it with an existing WKT. for examples :

   outSpatialReference= "{new SpatialReference('PROJCS["NAD_1927_StatePlane_Kansas_North_FIPS_1501",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]')}"


Gives me "PrintParameters must end with > or /> It seems the amount of quotation marks in the WKT is making it run wild.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Joe,


   OK that makes sense. Here is how you do it then:

        <fx:String id="myWKT">PROJCS["NAD_1927_StatePlane_Kansas_North_FIPS_1501",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]</fx:String>         <esri:PrintParameters id="printParameters"                               format="{formatsDDL.selectedItem}"                               layoutTemplate="{layoutTemplatesDDL.selectedItem}"                               map="{hostBaseWidget.map}"                               outSpatialReference="{new SpatialReference(Number.NaN, myWKT)}"                               preserveScale="{scaleCheckbox.selected}">             <esri:exportOptions>                 <esri:ExportOptions dpi="{dpiDD.selectedItem.dpi}"/>             </esri:exportOptions>             <esri:layoutOptions>                 <esri:LayoutOptions id="layoutOptions"/>             </esri:layoutOptions>         </esri:PrintParameters>

View solution in original post

0 Kudos
6 Replies
PaulHastings1
Occasional Contributor
if the quotes match up, that shouldn't be the issue.

probably stupid observation but the code you posted actually *is* missing a closing ">".
0 Kudos
JoeHewitt
New Contributor III
Full Code

 
  <esri:PrintParameters id="printParameters"
     format="{formatsDDL.selectedItem}"
     layoutTemplate="{layoutTemplatesDDL.selectedItem}"
           map="{hostBaseWidget.map}"

         outSpatialReference= "{new SpatialReference('PROJCS["NAD_1927_StatePlane_Kansas_North_FIPS_1501",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]')}"

 
        preserveScale="{scaleCheckbox.selected}">

   <esri:exportOptions>
   <esri:ExportOptions dpi="{dpiDD.selectedItem.dpi}"/>
   </esri:exportOptions>
   <esri:layoutOptions>
          <esri:LayoutOptions id="layoutOptions"/>
   </esri:layoutOptions>
           </esri:PrintParameters>





Error = Description Resource Path Location Type
Element type "esri:PrintParameters" must be followed by either attribute specifications, ">" or "/>". ExportWebMapForm.mxml /FlexViewer/src/widgets/Print line 507 Flex Problem
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Joe,

   Let me begin with a question. Why are you attempting to use a WKT when the WKID for NAD_1927_StatePlane_Kansas_North_FIPS_1501 is 26777?
0 Kudos
BjornSvensson
Esri Regular Contributor
Is it possible to create my own Well Known Text (WKT) for a coordinate system that is not registered with a WKID.


Yes it is 🙂
0 Kudos
JoeHewitt
New Contributor III
Joe,

   Let me begin with a question. Why are you attempting to use a WKT when the WKID for NAD_1927_StatePlane_Kansas_North_FIPS_1501 is 26777?


I am wanting to create and use my own WKT, but first I was checking to see if I could implement an already existing WKID just purely as a test, and I am getting an error trying to use it in my PrintParameters.

NAD_1927_StatePlane_Kansas_North_FIPS_1501 just happens to be a random example I selected. I am trying to implement a WKT in the PrintParameters of my ExportWebMapForm.mxml But keep getting an error, as you can see in my above post.

How do I pass my WKT into outSpatialReference?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Joe,


   OK that makes sense. Here is how you do it then:

        <fx:String id="myWKT">PROJCS["NAD_1927_StatePlane_Kansas_North_FIPS_1501",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",2000000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-98.0],PARAMETER["Standard_Parallel_1",38.71666666666667],PARAMETER["Standard_Parallel_2",39.78333333333333],PARAMETER["Latitude_Of_Origin",38.33333333333334],UNIT["Foot_US",0.3048006096012192]]</fx:String>         <esri:PrintParameters id="printParameters"                               format="{formatsDDL.selectedItem}"                               layoutTemplate="{layoutTemplatesDDL.selectedItem}"                               map="{hostBaseWidget.map}"                               outSpatialReference="{new SpatialReference(Number.NaN, myWKT)}"                               preserveScale="{scaleCheckbox.selected}">             <esri:exportOptions>                 <esri:ExportOptions dpi="{dpiDD.selectedItem.dpi}"/>             </esri:exportOptions>             <esri:layoutOptions>                 <esri:LayoutOptions id="layoutOptions"/>             </esri:layoutOptions>         </esri:PrintParameters>
0 Kudos