coverting CRS

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

coverting CRS

sammeek
Hi Board (Benjamin?)

I am writing a process that uses data sources with different CRS. I want to convert the data sources from their native CRS to another CRS, then perform some calculations, then convert the resultant dataset back into one of the input CRS. I am using the following line to establish the input CRS:

List <IData> inputObs = inputData.get("inputObservations");
FeatureCollection obsFcW = ((GTVectorDataBinding) inputObs.get(0)).getPayload();
CoordinateReferenceSystem sourceCRS = obsFcW.getSchema().getCoordinateReferenceSystem();

When I execute this via QGIS, I get the input CRS no problem. However when I execute via the Java client I get a null.

Any ideas?

Thanks
Sam

Reply | Threaded
Open this post in threaded view
|

Re: coverting CRS

BenjaminPross
Hi Sam,

I am not sure, why this doesn't work. A workaround could to be to use the following:

CoordinateReferenceSystem sourceCRS = (CoordinateReferenceSystem)((Geometry)((SimpleFeature)obsFcW.features().next()).getDefaultGeometry()).getUserData();

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: coverting CRS

sammeek
Hi Benjamin,

Thanks for the reply, still returning null value I'm afraid.

Sam
Reply | Threaded
Open this post in threaded view
|

Re: coverting CRS

BenjaminPross
Hi Sam,

I am afraid, I am stuck without being able to have a look at the data.
Can you attach an example?

Cheers,

Benjamin

Am 04.11.2014 16:20, schrieb sammeek:

> Hi Benjamin,
>
> Thanks for the reply, still returning null value I'm afraid.
>
> Sam
>
>
>
> --
> View this message in context: http://geoprocessing.forum.52north.org/coverting-CRS-tp4025903p4025905.html
> Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
> _______________________________________________
> Geoprocessingservices mailing list
> [hidden email]
> http://list.52north.org/mailman/listinfo/geoprocessingservices
> http://geoprocessing.forum.52north.org
> Please respect our mailing list guidelines:
> http://52north.org/resources/mailing-lists-and-forums/guidelines


--
Benjamin Proß
Software Engineer
52°North Geoprocessing Community

52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
Fon: +49-(0)-251–396371-42
Fax: +49-(0)-251–396371-11
[hidden email]
http://52north.org/

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: coverting CRS

sammeek
Reply | Threaded
Open this post in threaded view
|

Re: coverting CRS

BenjaminPross
Hi Sam,

The GML I receive from the above URL seems to be in version 2.1.2. If I use the GML2BasicParser, the code I posted before returns the CRS. If you use this parser you should also be able to access the CRS. (In case you are sending an execute request, choose the schema http://schemas.opengis.net/gml/2.1.2/feature.xsd and mime type text/xml for the input).

Hope this helps.

Cheers,

Benjamin