Hi Serega,

please, show your transformtoplanar function.

I don't think that cartesian means planar here, it is probably a 3d
projectin with a center at the center of the Earth (please, correct me if I
am wrong).

You need to look for an actual geographic projection for Moscow (
http://www.epsg-registry.org/  search for Name: Russia),
I think this could work for you EPSG::1198 -(it says Russian Federation in
comments).

Good luck

Cheers
--
Oleksandr (Sasha) Huziy


2013/2/14 serega_sh <[email protected]>

> Hi, Please help me. I have a mess in my head.
> My input:
> N lines with values:
> -longitude, latittude, (a senter of a sector)
> -radius (in meters 10...5000 meters)
> -start angle (from "12 o'clock")
> -angle width (in defrees)
>
> My output:
> Find sectors that intersects, output them to KML (or something else) and
> visualize (I've chosen KML because it can be uploaded to google maps and
> easilly seen)
>
> Here is my code....
>
> @Test(enabled = false)
>     public void visualizeRetailStoreMC7700001() throws ParserException,
> IOException, FactoryException, TransformException {
>         List<GSMCellLocation> gsmCellLocations =
> GeoDataSampleHelper.readGSMCellLocationFromMoscowRegion();
>         RetailStore retailStore =
> GeoDataSampleHelper.readRetailStoreByCode(MC7700001);
>         GeoPoint storeGeoPoint =
> retailStore.getStoreLocation().getGeoPoint();
>
>         List<Geometry> geometryList = new LinkedList<Geometry>();
>
>         GeometricShapeFactory gsFactory = new GeometricShapeFactory();
>         gsFactory.setCentre(transformToPlanar(new
> Coordinate(storeGeoPoint.getLongitude(),
> storeGeoPoint.getLatitude())));//storeGeoPoint.getLatitude(),
> storeGeoPoint.getLongitude())));
>         gsFactory.setSize(200);
>         Geometry storeCircle = gsFactory.createEllipse();
>         geometryList.add(storeCircle);
>
>         for(GSMCellLocation cellLoc : gsmCellLocations){
>             gsFactory = new GeometricShapeFactory();
>             gsFactory.setCentre(transformToPlanar(new
> Coordinate(cellLoc.getGeoPoint().getLongitude(),
>
> cellLoc.getGeoPoint().getLatitude())));//cellLoc.getGeoPoint().getLatitude(),
> cellLoc.getGeoPoint().getLongitude())));
>             gsFactory.setSize(cellLoc.getMidDist() * 2);
>             Geometry cellSector =
> gsFactory.createArc(cellLoc.getStartAngle(), cellLoc.getAngleWidth());
>
>             if(cellSector.intersects(storeCircle)){
>                 geometryList.add(cellSector);
>             }
>         }
>         LOG.info("geometryList.size {}",geometryList.size());
>
>
>         Encoder encoder = new Encoder(new KMLConfiguration());
>         encoder.setIndenting(true);
>
>         SimpleFeatureTypeBuilder typeBuilder = new
> SimpleFeatureTypeBuilder();
>         typeBuilder.setName("poi");
>         typeBuilder.add("geometry", Polygon.class,
> DefaultGeographicCRS.WGS84);//DefaultGeographicCRS.WGS84);
>
>         SimpleFeatureType TYPE = typeBuilder.buildFeatureType();
>
>
>         DefaultFeatureCollection features  = new
> DefaultFeatureCollection("test",TYPE);
>
>         for(int i=0; i<10; i++){
>             SimpleFeatureBuilder featureBuilder = new
> SimpleFeatureBuilder(TYPE);
>             featureBuilder.add(
> transformToGeo(geometryList.get(i)));//transformToGeo(
>             SimpleFeature simpleFeature =
> featureBuilder.buildFeature(String.valueOf(i + 1));
>             features.add( simpleFeature );
>         }
>         encoder.encode(features, KML.kml, System.out);
>
>     }
>
> What do I expect:
> Correctly calculated intersections between sectors
> correct kml output with intersected sectors
>
> Ofcourse, I don't get anyting correctly... (((
> Please help, I've spent more than a week trying to deal with geotools.
> Seems
> like I completely don't understand the idea of reprojecting CRS...
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/WGS84-to-a-Cartesian-transformation-tp4318606p5034219.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Free Next-Gen Firewall Hardware Offer
> Buy your Sophos next-gen firewall before the end March 2013
> and get the hardware for free! Learn more.
> http://p.sf.net/sfu/sophos-d2d-feb
> _______________________________________________
> GeoTools-GT2-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to