congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
org.geotools.factory
Code IndexAdd Tabnine to your IDE (free)

How to use org.geotools.factory

Best Java code snippets using org.geotools.factory (Showing top 20 results out of 855)

origin: geoserver/geoserver

public FidTransformeVisitor(FeatureTypeMap map) {
  super(CommonFactoryFinder.getFilterFactory2(null));
  this.map = map;
}
origin: geoserver/geoserver

public PropertyStyleHandler() {
  super("Property", FORMAT);
  styleFactory = CommonFactoryFinder.getStyleFactory();
  filterFactory = CommonFactoryFinder.getFilterFactory();
}
origin: opentripplanner/OpenTripPlanner

@Override
public GridCoverage2D getGridCoverage() {
  try {
    // There is a serious standardization failure around the axis order of WGS84. See issue #1930.
    // GeoTools assumes strict EPSG axis order of (latitude, longitude) unless told otherwise.
    // Both NED and SRTM data use the longitude-first axis order, so OTP makes grid coverages
    // for unprojected DEMs assuming coordinates are in (longitude, latitude) order.
    Hints forceLongLat = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
    GeoTiffFormat format = new GeoTiffFormat();
    GeoTiffReader reader = format.getReader(path, forceLongLat);
    coverage = reader.read(null);
    LOG.info("Elevation model CRS is: {}", coverage.getCoordinateReferenceSystem2D());
  } catch (IOException e) {
    throw new RuntimeException("Error getting coverage automatically. ", e);
  }
  return coverage;
}
origin: geoserver/geoserver

private CatalogInfo replaceCatalogInfo(CatalogInfo ci) {
  String id = ci.getId();
  Catalog catalog = (Catalog) GeoServerExtensions.bean("catalog");
  FilterFactory ff = CommonFactoryFinder.getFilterFactory();
  Class iface = getCatalogInfoInterface(ci.getClass());
  CatalogInfo replacement =
      catalog.get(iface, ff.equal(ff.property("id"), ff.literal(id), true));
  return replacement;
}
origin: geoserver/geoserver

Hints.putSystemDefault(Hints.FILTER_FACTORY, CommonFactoryFinder.getFilterFactory2(null));
Hints.putSystemDefault(Hints.STYLE_FACTORY, CommonFactoryFinder.getStyleFactory(null));
Hints.putSystemDefault(Hints.FEATURE_FACTORY, CommonFactoryFinder.getFeatureFactory(null));
origin: geotools/geotools

/**
 * Returns the first implementation of {@link StyleFactory}. If no implementation matches, a new
 * one is created if possible or an exception is thrown otherwise.
 *
 * @return The first style factory available
 * @throws FactoryRegistryException if no implementation was found or can be created for the
 *     {@link StyleFactory} interface.
 * @see Hints#STYLE_FACTORY
 */
public static StyleFactory getStyleFactory() throws FactoryRegistryException {
  return getStyleFactory(null);
}
origin: geotools/geotools

public void testGetDefaultFeatureFactory() {
  FeatureFactory featureFactory = CommonFactoryFinder.getFeatureFactory(null);
  assertNotNull(featureFactory);
  assertTrue(featureFactory instanceof AbstractFeatureFactoryImpl);
}
origin: geotools/geotools

/**
 * Gets an instance of the FeatureLockFactory.
 *
 * @return A FeatureLockFactory instance.
 * @throws FactoryRegistryException If there exists a configuration error.
 */
public static FeatureLockFactory getInstance() throws FactoryRegistryException {
  if (factory == null) {
    factory = CommonFactoryFinder.getFeatureLockFactory(null);
  }
  return factory;
}
origin: geoserver/geoserver

@Before
public void setUp() throws Exception {
  data = File.createTempFile("retype", "data", new File("./target"));
  data.delete();
  data.mkdir();
  final String fileName = MockData.BUILDINGS.getLocalPart() + ".properties";
  URL properties = MockData.class.getResource(fileName);
  IOUtils.copy(properties.openStream(), new File(data, fileName));
  PropertyDataStore pds = new PropertyDataStore(data);
  rts =
      new RetypingDataStore(pds) {
        @Override
        protected String transformFeatureTypeName(String originalName) {
          if (originalName.equals(MockData.BUILDINGS.getLocalPart())) return RENAMED;
          else return super.transformFeatureTypeName(originalName);
        }
      };
  // build a filter that will retrieve one feature only
  FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
  fid = RENAMED + ".1107531701011";
  fidFilter = ff.id(Collections.singleton(ff.featureId(fid)));
}
origin: geoserver/geoserver

@Test
public void testMaxVisitorDelegation() throws SchemaException, IOException {
  MaxVisitor visitor =
      new MaxVisitor(CommonFactoryFinder.getFilterFactory2().property("value"));
  assertOptimalVisit(visitor);
}
origin: geoserver/geoserver

@Test
public void testEmptyStyle() throws Exception {
  SLDParser parser = new SLDParser(CommonFactoryFinder.getStyleFactory());
  parser.setInput(StylesTest.class.getResourceAsStream("empty.sld"));
  StyledLayerDescriptor sld = parser.parseSLD();
  assertNull(Styles.style(sld));
}
origin: geoserver/geoserver

FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
fid = RENAMED + ".f001";
fidFilter = ff.id(Collections.singleton(ff.featureId(fid)));
origin: geoserver/geoserver

FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
origin: geoserver/geoserver

  @Override
  public Void answer() throws Throwable {
    Object[] args = getCurrentArguments();
    InputStream is = (InputStream) args[1];
    byte[] input = IOUtils.toByteArray(is);
    SLDParser parser =
        new SLDParser(CommonFactoryFinder.getStyleFactory());
    parser.setInput(new ByteArrayInputStream(input));
    StyledLayerDescriptor sld = parser.parseSLD();
    NamedLayer nl = (NamedLayer) sld.getStyledLayers()[0];
    assertEquals("foo", nl.getName());
    Style style = nl.getStyles()[0];
    assertEquals(
        "A raster style",
        style.getDescription().getTitle().toString());
    assertEquals(1, style.featureTypeStyles().size());
    FeatureTypeStyle fts = style.featureTypeStyles().get(0);
    assertEquals(1, fts.rules().size());
    assertThat(
        fts.rules().get(0).symbolizers().get(0),
        instanceOf(RasterSymbolizer.class));
    // make sure it's valid
    SLDValidator validator = new SLDValidator();
    List errors =
        validator.validateSLD(new ByteArrayInputStream(input));
    assertEquals(0, errors.size());
    return null;
  }
});
origin: geoserver/geoserver

FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
dq.setFilter(ff.greater(ff.property("PERSONS"), ff.literal(20000000)));
FeatureCollection fc = fs.getFeatures(dq);
origin: geoserver/geoserver

    new SLDParser(CommonFactoryFinder.getStyleFactory());
parser.setInput(new ByteArrayInputStream(input));
StyledLayerDescriptor sld = parser.parseSLD();
origin: geoserver/geoserver

addNamespace();
final FilterFactory factory = CommonFactoryFinder.getFilterFactory();
origin: geoserver/geoserver

assertEquals(BRIDGES.getLocalPart(), rs.getTypeNames()[0]);
FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
String fid = BRIDGES.getLocalPart() + ".1107531701011";
Filter fidFilter = ff.id(Collections.singleton(ff.featureId(fid)));
origin: geoserver/geoserver

@Test
public void testFeautureSourceFidFilter() throws Exception {
  // grab the last feature in the collection (there are more than one)
  SimpleFeatureSource fs = rts.getFeatureSource(RENAMED);
  // build a filter that will retrieve that feature only
  FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
  final String fid = RENAMED + ".1107531701011";
  Filter fidFilter = ff.id(Collections.singleton(ff.featureId(fid)));
  SimpleFeatureCollection fc = fs.getFeatures(new Query(RENAMED, fidFilter));
  assertEquals(RENAMED, fc.getSchema().getName().getLocalPart());
  assertEquals(1, fc.size());
  FeatureIterator<SimpleFeature> it = fc.features();
  assertTrue(it.hasNext());
  SimpleFeature sf = it.next();
  assertFalse(it.hasNext());
  it.close();
  assertEquals(fid, sf.getID());
}
origin: geoserver/geoserver

@Test
public void testFeautureSourceFidFilter() throws Exception {
  // grab the last feature in the collection (there are more than one)
  SimpleFeatureSource fs = rts.getFeatureSource(RENAMED);
  // build a filter that will retrieve that feature only
  FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
  final String fid = RENAMED + ".f001";
  Filter fidFilter = ff.id(Collections.singleton(ff.featureId(fid)));
  SimpleFeatureCollection fc = fs.getFeatures(new Query(RENAMED, fidFilter));
  assertEquals(RENAMED, fc.getSchema().getName().getLocalPart());
  assertEquals(1, fc.size());
  FeatureIterator<SimpleFeature> it = fc.features();
  assertTrue(it.hasNext());
  SimpleFeature sf = it.next();
  assertFalse(it.hasNext());
  it.close();
  assertEquals(fid, sf.getID());
}
org.geotools.factory

Most used classes

  • Hints
    A set of hints providing control on factories to be used. Those hints are typically used by renderer
  • CommonFactoryFinder
    Defines static methods used to access the application's default implementation for some common facto
  • GeoTools
  • FactoryRegistry
    A registry for factories, organized by categories (usualy by interface). For example org.opengis.ref
  • FactoryCreator
    A FactoryRegistry capable to creates factories if no appropriate instance was found in the registry.
  • FactoryNotFoundException,
  • BasicFactories,
  • Hints$Key,
  • AbstractFactory,
  • Factory,
  • FactoryComparator,
  • FactoryIteratorProvider,
  • Hints$ClassKey,
  • OptionalFactory,
  • RecursiveSearchException,
  • StrictHints,
  • CommonFactoryFinderTest,
  • Factories,
  • FactoryIteratorProviders
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now