Package org.geomajas.geometry

Examples of org.geomajas.geometry.Crs


  }

  @Test
  public void transformGeometryCrs() throws Exception {
    Geometry geometry = getLineString();
    Crs source = geoService.getCrs2(LONLAT);
    Crs target = geoService.getCrs2(LAMBERT72);
    geometry = geoService.transform(geometry, source, target);
    assertTransformedLineString(geometry);
  }
View Full Code Here


  @Qualifier("beans")
  Layer beansLayer;

  @Test
  public void getLayerCrsTest() throws Exception {
    Crs crs = layerService.getCrs(beansLayer);
    Assert.assertNotNull(crs);
    Assert.assertEquals(beansLayer.getLayerInfo().getCrs(), crs.getId());
  }
View Full Code Here

    if (null != request.getLocale()) {
      locale = new Locale(request.getLocale());
    }
    int maxAlternatives = request.getMaxAlternatives();

    Crs crs = geoService.getCrs2(crsString);

    SplitGeocoderStringService splitGeocoderStringService = geocoderInfo.getSplitGeocoderStringService();
    if (null == splitGeocoderStringService) {
      splitGeocoderStringService = defaultSplitGeocoderStringService;
    }
View Full Code Here

    securityManager.clearSecurityContext();
  }

  @Test
  public void testVerifyConversion() throws Exception {
    Crs mercator = geoService.getCrs2("EPSG:900913");
    Crs lonlat = geoService.getCrs2("EPSG:4326");

    layerToMap = geoService.findMathTransform(mercator, lonlat);

    List<InternalFeature> features;
    Filter filter = filterService.createFidFilter(new String[] {FEATURE_ID});
View Full Code Here

    Rectangle tileInpix = mapContext.getViewport().getScreenArea();
    ReferencedEnvelope metaArea = new ReferencedEnvelope(areaOfInterest);
    metaArea.expandBy(bufferInPixels / tileInpix.getWidth() * areaOfInterest.getWidth(),
        bufferInPixels / tileInpix.getHeight() * areaOfInterest.getHeight());
    // fetch features in meta area
    Crs layerCrs = vectorLayerService.getCrs(layer);
    Envelope layerBounds = geoService.transform(metaArea, (Crs) areaOfInterest.getCoordinateReferenceSystem(),
        layerCrs);
    Filter filter = filterService.createBboxFilter(layerCrs, layerBounds,
        layer.getLayerInfo().getFeatureInfo().getGeometryType().getName());
    if (extraInfo.getFilter() != null) {
View Full Code Here

    Assert.assertEquals(0, geoService.getSridFromCrs("bla"));
  }

  @Test
  public void getCrs2Test() throws Exception {
    Crs crs = geoService.getCrs2(MERCATOR);
    Assert.assertNotNull(crs);
    Assert.assertEquals(900913, geoService.getSridFromCrs(crs));
    Assert.assertEquals(MERCATOR, geoService.getCodeFromCrs(crs));
    crs = geoService.getCrs2(LONLAT);
    Assert.assertNotNull(crs);
View Full Code Here

    }
  }

  @Test
  public void transformEnvelopeCrsTest() throws Exception {
    Crs source = geoService.getCrs2(MERCATOR);
    Crs target = geoService.getCrs2(LONLAT);
    Envelope envelope = new Envelope(10, 20, 30, 40);
    Envelope transformed = geoService.transform(envelope, source, target);
    Assert.assertEquals(8.983152841195215E-5, transformed.getMinX(), DELTA);
    Assert.assertEquals(2.6949458522981454E-4, transformed.getMinY(), DELTA);
    Assert.assertEquals(1.796630568239043E-4, transformed.getMaxX(), DELTA);
View Full Code Here

    Assert.assertEquals(envelope, geoService.transform(envelope, MERCATOR, MERCATOR));
  }

  @Test
  public void transformBboxCrsTest() throws Exception {
    Crs source = geoService.getCrs2(MERCATOR);
    Crs target = geoService.getCrs2(LONLAT);
    Bbox bbox = new Bbox(10, 30, 10, 10);
    Bbox transformed = geoService.transform(bbox, source, target);
    Assert.assertEquals(8.983152841195215E-5, transformed.getX(), DELTA);
    Assert.assertEquals(2.6949458522981454E-4, transformed.getY(), DELTA);
    Assert.assertEquals(1.796630568239043E-4, transformed.getMaxX(), DELTA);
View Full Code Here

  }

  @Test
  public void transformGeometryCrs() throws Exception {
    Geometry geometry = getLineString();
    Crs source = geoService.getCrs2(LONLAT);
    Crs target = geoService.getCrs2(LAMBERT72);

    Assert.assertEquals(geometry, geoService.transform(geometry, source, source));

    geometry = geoService.transform(geometry, source, target);
    assertTransformedLineString(geometry);
View Full Code Here

  private GeoService geoService;

  @Test
  public void testLevels() throws Exception {
    // this test failed before http://jira.geomajas.org/browse/WMS-18
    Crs latlon = geoService.getCrs2(LONLAT);
    Envelope latlonEnvelope = null;
    for (int level = 0; level < 32; level++) {
      double latlonScale = Math.pow(2, level);
      // must reduce envelope as we zoom
      latlonEnvelope = new Envelope(-180, -180 + 1.0 / latlonScale, -412, -412 + 1.0 / latlonScale);
View Full Code Here

TOP

Related Classes of org.geomajas.geometry.Crs

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.