public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof GMLInfo)) return false; final GMLInfo other = (GMLInfo) obj; if (srsNameStyle == null) { if (other.getSrsNameStyle() != null) return false; } else if (!srsNameStyle.equals(other.getSrsNameStyle())) return false; return true; }
private String applySRSNameStyle(GMLInfo gml, String srs) { if (srs != null) { String prefix = gml.getSrsNameStyle().getPrefix(); if (srs.matches("(?ui)EPSG:[0-9]+")) { srs = prefix + srs.substring(5); } else { srs = prefix + srs; } } return srs; }
public DomainType getSrsParameter(WFSInfo wfs) { List<String> extraSRS = wfs.getSRS(); Set<String> srsParameterValues; GMLInfo gml = wfs.getGML().get(WFSInfo.Version.V_20); String prefix = gml.getSrsNameStyle().getPrefix(); Function<String, String> epsgMapper = srs -> qualifySRS(prefix, srs); if (extraSRS != null && !extraSRS.isEmpty()) { srsParameterValues = extraSRS.stream() .map(epsgMapper) .collect(Collectors.toCollection(LinkedHashSet::new)); } else { srsParameterValues = new LinkedHashSet<>(); } // add values from feature types gs.getCatalog() .getFeatureTypes() .forEach( ft -> { String srs = epsgMapper.apply(ft.getSRS()); srsParameterValues.add(srs); }); // build the parameter DomainType srsParameter = new DomainType("srsName", new ArrayList<>(srsParameterValues)); return srsParameter; }
wfs.getGML().get(WFSInfo.Version.V_11).getSrsNameStyle().toSrsSyntax());
@Override protected Configuration customizeConfiguration( Configuration configuration, Map<String, Set<ResourceInfo>> resources, Object request) { FeatureTypeSchemaBuilder schemaBuilder = new FeatureTypeSchemaBuilder.GML32(geoServer); ApplicationSchemaXSD2 xsd = new ApplicationSchemaXSD2(schemaBuilder); xsd.setBaseURL(GetFeatureRequest.adapt(request).getBaseURL()); xsd.setResources(resources); org.geotools.wfs.v2_0.WFSConfiguration wfs = new org.geotools.wfs.v2_0.WFSConfiguration(); wfs.getDependency(GMLConfiguration.class) .setSrsSyntax( getInfo() .getGML() .get(WFSInfo.Version.V_20) .getSrsNameStyle() .toSrsSyntax()); ApplicationSchemaConfiguration2 config = new ApplicationSchemaConfiguration2(xsd, wfs); // adding properties from original configuration to allow // hints handling config.getProperties().addAll(configuration.getProperties()); return config; }
transformer.setSrsName(gml.getSrsNameStyle().getPrefix() + srs);