<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Projecting data on the fly using spatial references... in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/projecting-data-on-the-fly-using-spatial/m-p/389602#M10351</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;BLOCKQUOTE&gt;bzborow1;18473 wrote:&lt;BR /&gt;Hi Guys,&lt;/BLOCKQUOTE&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm building a search service to query unprojected attribute data, project it, and deliver the extent back to the client.&amp;nbsp; The method I'm using works unpredictably.&amp;nbsp; For are larger land parcels it re-projects perfectly find, but for really small land parcels, quarter sections, it won't reproject using the getEnvelope() method.&amp;nbsp; Can anyone offer some advice on how I might fix this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;QUOTE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am speculating that it could a problem with the resolution/domain values of the target spatialreference (less likely: the tolerance). Perhaps the resolution value is too large and the envelopes are collapsing. Another possibility is that the envelope, after projecting it, is distorted enough that it's collapsing. I think that would be more likely with 'long' sides--they should be densified to reflect what's happening when the data's projected, aren't. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Melita&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jun 2010 18:16:07 GMT</pubDate>
    <dc:creator>MelitaKennedy</dc:creator>
    <dc:date>2010-06-11T18:16:07Z</dc:date>
    <item>
      <title>Projecting data on the fly using spatial references...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/projecting-data-on-the-fly-using-spatial/m-p/389601#M10350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm building a search service to query unprojected attribute data, project it, and deliver the extent back to the client.&amp;nbsp; The method I'm using works unpredictably.&amp;nbsp; For are larger land parcels it re-projects perfectly find, but for really small land parcels, quarter sections, it won't reproject using the getEnvelope() method.&amp;nbsp; Can anyone offer some advice on how I might fix this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a snippet of the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
// Step 2: Get reference to SOM.
IServerObjectManager som = conn.getServerObjectManager();
&amp;nbsp; 
// Step 3: Get Map object reference.
IServerContext context = som.createServerContext("myGeodataService", "GeoDataServer");
IGeoDataServer gs = (IGeoDataServer)context.getServerObject();
&amp;nbsp; 
// Step 4: Set up query filter.
IQueryFilter qf = (IQueryFilter)context.createObject(QueryFilter.getClsid());
StringBuffer whereClause = new StringBuffer("");
int i = 0;
for(CplDLSQuarter value: queryResults) {
 if(i == 0) whereClause.append("LAND_PARCEL_IDENTIFIER = '" + value.getLandParcelId() + "'");
 else whereClause.append(" OR LAND_PARCEL_IDENTIFIER = '" + value.getLandParcelId() + "'");
 ++i;
}
if (whereClause.length() &amp;gt; 1) qf.setWhereClause(whereClause.toString());
SpatialReferenceEnvironment srFactory = (SpatialReferenceEnvironment)context.createObject(SpatialReferenceEnvironment.getClsid());
ProjectedCoordinateSystem pcSystem = (ProjectedCoordinateSystem)srFactory.createESRISpatialReferenceFromPRJFile(ags.getProjectionsMap().get(proj));
qf.setOutputSpatialReferenceByRef("SHAPE", pcSystem);
&amp;nbsp; 
IResultPortionInfo rpi = (IResultPortionInfo)context.createObject(ResultPortionInfo.getClsid());
rpi.setStartIndex(0);
rpi.setCount(gs.getMaxRecordCount());
&amp;nbsp; 
IGDSQueryResultPortion resPortion = gs.tableSearch(
&amp;nbsp; gs.getDefaultWorkingVersion(), 
&amp;nbsp; "SCHEMA.SDE_TABLE", 
&amp;nbsp; qf, 
&amp;nbsp; rpi);
&amp;nbsp; 
IRecordSet recs = resPortion.getRecords();
ICursor cursor = recs.getCursor(true);
IRow row;
while ((row = cursor.nextRow()) != null) {
 ResultType result = new ResultType();
 AttributesType attributes = new AttributesType();
&amp;nbsp; 
 //get the polygon.
 Polygon poly = (Polygon)row.getValue(9);
 poly.setSpatialReferenceByRef(pcSystem);
 ExtentType extent = new ExtentType();
 extent.setMaxx(new BigDecimal(poly.getEnvelope().getXMax()));
 extent.setMaxy(new BigDecimal(poly.getEnvelope().getYMax()));
 extent.setMinx(new BigDecimal(poly.getEnvelope().getXMin()));
 extent.setMiny(new BigDecimal(poly.getEnvelope().getYMin()));
 result.setExtent(extent);
&amp;nbsp;&amp;nbsp; 
 //add the rest of the attributes.
 //attributes.getAttribute().add(CplUtils.replaceNull());
 attributes.getAttribute().add(CplUtils.replaceNull(poly.getSpatialReference().getName()));
 attributes.getAttribute().add(CplUtils.replaceNull(row.getValue(0).toString()));
 attributes.getAttribute().add(CplUtils.replaceNull(row.getValue(1).toString()));
 attributes.getAttribute().add(CplUtils.replaceNull(row.getValue(4).toString()));
 attributes.getAttribute().add(CplUtils.replaceNull(row.getValue(5).toString()));
 attributes.getAttribute().add(CplUtils.replaceNull(row.getValue(8).toString()));
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 result.setAttributes(attributes);
 
 //attach result to results
 results.getResult().add(result);
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 12:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/projecting-data-on-the-fly-using-spatial/m-p/389601#M10350</guid>
      <dc:creator>BillZborowski1</dc:creator>
      <dc:date>2010-06-11T12:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Projecting data on the fly using spatial references...</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/projecting-data-on-the-fly-using-spatial/m-p/389602#M10351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;BLOCKQUOTE&gt;bzborow1;18473 wrote:&lt;BR /&gt;Hi Guys,&lt;/BLOCKQUOTE&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm building a search service to query unprojected attribute data, project it, and deliver the extent back to the client.&amp;nbsp; The method I'm using works unpredictably.&amp;nbsp; For are larger land parcels it re-projects perfectly find, but for really small land parcels, quarter sections, it won't reproject using the getEnvelope() method.&amp;nbsp; Can anyone offer some advice on how I might fix this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;QUOTE]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am speculating that it could a problem with the resolution/domain values of the target spatialreference (less likely: the tolerance). Perhaps the resolution value is too large and the envelopes are collapsing. Another possibility is that the envelope, after projecting it, is distorted enough that it's collapsing. I think that would be more likely with 'long' sides--they should be densified to reflect what's happening when the data's projected, aren't. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Melita&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 18:16:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/projecting-data-on-the-fly-using-spatial/m-p/389602#M10351</guid>
      <dc:creator>MelitaKennedy</dc:creator>
      <dc:date>2010-06-11T18:16:07Z</dc:date>
    </item>
  </channel>
</rss>

