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

How to use
FidFilter
in
org.geotools.filter

Best Java code snippets using org.geotools.filter.FidFilter (Showing top 19 results out of 315)

origin: org.geotools/gt2-shapefile

public void visit(FidFilter filter) {
  fids.addAll(Arrays.asList(filter.getFids()));
}
origin: org.geotools/gt2-main

public void visit(FidFilter filter) {
  FidFilter copy = ff.createFidFilter();
  
  String[] fids = filter.getFids();
  for (int i = 0; i < fids.length; i++) {
    copy.addFid(fids[i]);
  }
  
  pages.push(copy);
}
origin: org.geotools/gt-wfs

/**
 * @see org.geotools.xml.schema.Type#getValue(org.geotools.xml.schema.Element,
 *      org.geotools.xml.schema.ElementValue[],
 *      org.xml.sax.Attributes, java.util.Map)
 */
public Object getValue(Element element, ElementValue[] value,
  Attributes attrs, Map hints)
  throws SAXException, SAXNotSupportedException {
  if ((element == null) || (value == null)
      || (element.getType() == null)) {
    throw new SAXException("Invalid parameters : null found");
  }
  if (value.length < 1) {
    throw new SAXException("Invalid children: too few");
  }
  if (!getName().equals(element.getType().getName())) {
    throw new SAXException("Invalid type name for element provided");
  }
  Set fidSet = new HashSet();
  for (int i = 0; i < value.length; i++)
    fidSet.addAll(Arrays.asList(
        ((FidFilter) value[i].getValue()).getFids()));
  FidFilter r = FilterFactoryFinder.createFilterFactory().createFidFilter();
  r.addAllFids(fidSet);
  return r;
}
origin: org.geotools/gt-main

/**
 * Sets the filter attributes.  Called when attributes are encountered by
 * the filter filter.  Puts them in a hash map by thier name and  value.
 *
 * @param atts the attributes to set.
 */
public void setAttributes(Attributes atts) {
  LOGGER.finer("got attribute: " + atts.getLocalName(0) + ", "
    + atts.getValue(0));
  LOGGER.finer("current state: " + curState);
  if (curState.equals("fid")) {
    LOGGER.finer("is a fid");
    ((FidFilter) curFilter).addFid(atts.getValue(0));
    LOGGER.finer("added fid");
  } else {
    for (int i = 0; i < atts.getLength(); i++) {
      this.attributes.put(atts.getLocalName(i), atts.getValue(i));
    }
  }
}
origin: org.geotools/gt2-postgis-versioned

public void visit(FidFilter filter) {
  Set ids = filter.getIDs();
  if (ids.isEmpty()) {
    throw new IllegalArgumentException(
origin: org.geotools/gt-wfs

/**
 * @see org.geotools.xml.schema.Type#getValue(org.geotools.xml.schema.Element,
 *      org.geotools.xml.schema.ElementValue[],
 *      org.xml.sax.Attributes, java.util.Map)
 */
public Object getValue(Element element, ElementValue[] value,
  Attributes attrs, Map hints)
  throws SAXException, SAXNotSupportedException {
  if ((element == null) || (value == null)
      || (element.getType() == null)) {
    throw new SAXException("Invalid parameters : null found");
  }
  if (value.length < 1) {
    throw new SAXException("Invalid children: too few");
  }
  if (!getName().equals(element.getType().getName())) {
    throw new SAXException("Invalid type name for element provided");
  }
  Set fidSet = new HashSet();
  for (int i = 0; i < value.length; i++)
    fidSet.addAll(Arrays.asList(
        ((FidFilter) value[i].getValue()).getFids()));
  FidFilter r = FilterFactoryFinder.createFilterFactory().createFidFilter();
  r.addAllFids(fidSet);
  return r;
}
origin: org.geotools/gt2-main

/**
 * Sets the filter attributes.  Called when attributes are encountered by
 * the filter filter.  Puts them in a hash map by thier name and  value.
 *
 * @param atts the attributes to set.
 */
public void setAttributes(Attributes atts) {
  LOGGER.finer("got attribute: " + atts.getLocalName(0) + ", "
    + atts.getValue(0));
  LOGGER.finer("current state: " + curState);
  if (curState.equals("fid")) {
    LOGGER.finer("is a fid");
    ((FidFilter) curFilter).addFid(atts.getValue(0));
    LOGGER.finer("added fid");
  } else {
    for (int i = 0; i < atts.getLength(); i++) {
      this.attributes.put(atts.getLocalName(i), atts.getValue(i));
    }
  }
}
origin: org.geotools/gt2-main

protected void queryFidFilter() {
  FidFilter fidFilter = (FidFilter) filter;
  if (fidIndex == -1) {
    fidIndex = 0;
  }
  while( fidIndex < fidFilter.getFids().length && next == null ) {
    String fid = fidFilter.getFids()[fidIndex];
    if( encounteredFids.contains(fid) ){
      fidIndex++;
      continue;
    }
    next = (Feature) diff.modified2.get(fid);
    if( next==null ){
      next = (Feature) diff.added.get(fid);
    }
    fidIndex++;
  }
}

origin: org.geotools/gt2-main

FidFilter fidFilter = FILTER_FACT.createFidFilter();
Element fidElement = (Element) child;
fidFilter.addFid(fidElement.getAttribute("fid"));
      fidFilter.addFid(fidElement.getAttribute("fid"));
origin: org.geotools/gt2-main

public void visit(org.geotools.filter.FidFilter filter) {
  String[] fids = filter.getFids();
  
  for (int i = 0; i < fids.length; i++) {
    AttributesImpl atts = new AttributesImpl();
    atts.addAttribute("", "fid", "fid", "", fids[i]);
    element("FeatureId",null,atts);
  }
}

origin: org.geotools/gt2-main

create.addFid("road.rd1");
create.addFid("road.rd2");
origin: org.geotools/gt-oracle-spatial

String[] fids = filter.getFids();
LOGGER.finer("Exporting FID=" + Arrays.asList(fids));
origin: org.geotools/gt-postgis

private FidFilter getEncodableFilter(Filter unEncodableFilter)
  throws IOException, FactoryRegistryException, IllegalAttributeException {
  // this is very similar to getFidSet - the reason is so that we
  // don't spend time constructing geometries when we don't need
  // to, but we probably could get some better code reuse.
  DefaultQuery query = new DefaultQuery();
  query.setPropertyNames(new String[0]);
  query.setFilter(unEncodableFilter);
  SimpleFeatureCollection features = getFeatures(unEncodableFilter);
  FilterFactory ff = FilterFactoryFinder.createFilterFactory();
  FidFilter fidFilter = ff.createFidFilter();
  SimpleFeatureIterator it = features.features();
  try {
    while( it.hasNext() ) {
      SimpleFeature feature = (SimpleFeature) it.next();
      fidFilter.addFid(feature.getID());
    }
  } finally {
   features.close( it );  
  }
  return fidFilter;
}
origin: org.geotools/gt-jdbc

String[] fids = filter.getFids();
LOGGER.finer("Exporting FID=" + Arrays.asList(fids));
origin: org.geotools/gt-wfs

/**
 * @see org.geotools.xml.schema.Type#getValue(org.geotools.xml.schema.Element,
 *      org.geotools.xml.schema.ElementValue[],
 *      org.xml.sax.Attributes, java.util.Map)
 */
public Object getValue(Element element, ElementValue[] value,
  Attributes attrs1, Map hints)
  throws SAXException, SAXNotSupportedException {
  if ((element == null) || (value == null)
      || (element.getType() == null)) {
    throw new SAXException("Invalid parameters : null found");
  }
  if (value.length < 1) {
    throw new SAXException("Invalid children: too few");
  }
  if (!getName().equals(element.getType().getName())) {
    throw new SAXException("Invalid type name for element provided");
  }
  List fidList = new ArrayList();
  for (int i = 0; i < value.length; i++)
    fidList.addAll(Arrays.asList(
        ((FidFilter) value[i].getValue()).getFids()));
  return fidList;
}
origin: org.geotools/gt2-jdbc

String[] fids = filter.getFids();
LOGGER.finer("Exporting FID=" + Arrays.asList(fids));
origin: org.geotools/gt-wfs

private void handleDeleteAction(List<Action> actions, int i, InsertAction action,
    DeleteAction deleteAction) {
  // if inserted action has been deleted then remove action
  if (deleteAction.getFilter().evaluate(action.getFeature())) {
    actions.remove(i);
    // if filter is a fid filter of size 1 then it only contains the
    // inserted feature which
    // no longer exists since it has been deleted. so remove that action
    // as well.
    if (deleteAction.getFilter() instanceof FidFilter
        && ((FidFilter) deleteAction.getFilter()).getFids().length == 1) {
      actions.remove(i);
    }
  } else {
    swap(actions, i);
  }
}
origin: org.geotools/gt-wfs

private int handleUpdateAction(List<Action> actions, int i, InsertAction action,
    UpdateAction updateAction) {
  // if update action applies to feature then update feature
  if (updateAction.getFilter().evaluate(action.getFeature())) {
    updateAction.update(action.getFeature());
    // if filter is a fid filter and there is only 1 fid then filter
    // uniquely identifies
    // only the
    // one features so remove it.
    if (updateAction.getFilter() instanceof FidFilter
        && ((FidFilter) updateAction.getFilter()).getFids().length == 1) {
      actions.remove(i + 1);
      return i;
    }
  }
  swap(actions, i);
  return i + 1;
}
origin: org.geotools/gt2-shapefile

if (filter instanceof FidFilter && fixURL!=null ) {
  FidFilter fidFilter = (FidFilter) filter;
  goodRecs = queryFidIndex(fidFilter.getFids());
} else {
  if (filter != null) {
org.geotools.filterFidFilter

Javadoc

Defines a feature ID filter, which holds a list of feature IDs. This filter stores a series of feature IDs, which are used to distinguish features uniquely.

Most used methods

  • getFids
    Returns all the fids in this filter.
  • addFid
    Adds a feature ID to the filter.
  • addAllFids
    Adds a collection of feature IDs to the filter.
  • getIDs

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top 17 PhpStorm Plugins
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