[udig-devel] Re: creating a temporary layer and crs

Jesse Eichar jeichar.w at gmail.com
Thu May 15 00:27:21 PDT 2008


No setter is correct.  You have to recreate the geometry. I think the  
FeatureTypeBuilder can take a FeatureType and then you can change the  
attributesTypes of the feature type then do a createFeatureType or  
some such.

Jesse
On 14-May-08, at 5:16 PM, andrea antonello wrote:

>> I don't mean the geometry.  I meant the GeometryAttribute instance  
>> obtained
>> from the FeatureType.  ft.getDefaultGeometry() for example
>
> Ups, sorry, didn't get that right.
>
> However  ft.getDefaultGeometry() gives me a Geometry, therefore, I
> have the same problem.
>
> Instead the geometryattribute has only a getCoordinateSystem(), which
> is told to be out of date in the docs. No setter though.
>
> Andrea
>
>
>>
>> Jesse
>>
>>
>>
>> On 14-May-08, at 3:59 PM, andrea antonello wrote:
>>
>>
>>> Thanks for the answers guys.
>>>
>>> Jody: I need to define the crs also for the temporary layer, which
>>> doesn't back up on a ShapefileDataStore. My coordinates are drawn as
>>> if they were epsg:4326, but using my coordinates metric UTM.
>>>
>>> Jesse: that is a news for me, I didn't this that Geometry JTS should
>>> knkow about projections, since it is "just" a geometry engine.  
>>> Hmmm, I
>>> see a setSRID(int srid), which I imagine to be the thing I should  
>>> do,
>>> but what is srid? The epsg code? The doc says the id of the spatial
>>> reference system.
>>>
>>>
>>> Andrea
>>>
>>>
>>> On Wed, May 14, 2008 at 1:15 AM, Jody Garnett <jgarnett at refractions.net 
>>> >
>> wrote:
>>>
>>>> Can you "force" the projection in the ShapefileDataStore when you  
>>>> are
>>>> creating it?
>>>>
>>>> Jody
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>>> Huh, I found were I already heard about it :)
>>>>>
>>>>> http://jira.codehaus.org/browse/UDIG-970
>>>>>
>>>>> Any news about this?
>>>>>
>>>>> Andrea
>>>>>
>>>>>
>>>>> On Mon, May 12, 2008 at 11:53 AM, andrea antonello
>>>>> <andrea.antonello at gmail.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>>> Hi, I think I had this problem before, but not on temporary  
>>>>>> layers.
>>>>>> I am creating one with:
>>>>>>
>>>>>>     IGeoResource resource =
>>>>>>
>>>>>
>>>> CatalogPlugin.getDefault().getLocalCatalog()
>>>>
>>>>>
>>>>>>             .createTemporaryResource(fet.getSchema());
>>>>>>     try {
>>>>>>
>>>>>>         FeatureStore fStore =  
>>>>>> resource.resolve(FeatureStore.class,
>>>>>>                 new NullProgressMonitor());
>>>>>>         fStore.addFeatures(fet);
>>>>>>     } catch (IOException e) {
>>>>>>         e.printStackTrace();
>>>>>>     }
>>>>>>     ApplicationGIS.addLayersToMap(ApplicationGIS.getActiveMap(),
>>>>>>             Collections.singletonList(resource), -1);
>>>>>>
>>>>>>
>>>>>> But I get:
>>>>>>
>>>>>>
>>>>>
>>>>
>> org 
>> .geotools 
>> .referencing.operation.projection.PointOutsideEnvelopeException:
>>>>
>>>>>
>>>>>> Longitude 607659°34.4'E is out of range (±180°).
>>>>>>
>>>>>> since it is trying to interprete my coordinates as lat/long.  
>>>>>> Since
>> on
>>>>>> a featurestore I can't force a crs, how can I solve this?
>>>>>>
>>>>>> Ciao
>>>>>> Andrea
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>> http://udig.refractions.net
>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> User-friendly Desktop Internet GIS (uDig)
>>>> http://udig.refractions.net
>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>
>>>>
>>> _______________________________________________
>>> User-friendly Desktop Internet GIS (uDig)
>>> http://udig.refractions.net
>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>
>>
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel



More information about the udig-devel mailing list