log.warn("This prj file is null. \n A default srid equals to 0 will be added."); } else { PrjParser parser = new PrjParser(); String prjString = readPRJFile(prjFile); if (!prjString.isEmpty()) { Map<String, String> p = parser.getParameters(prjString); String authorityWithCode = p.get(PrjKeyParameters.REFNAME); if (authorityWithCode != null) {
char next = next(s); if (next == '"') { elms.add(parseString(s)); } else { s.position(s.position() - 1); if (Character.isDigit(next) || next == '-') { elms.add(parseNumber(s)); } else { elms.add(parseNode(s)); next = next(s); switch (next) { case ',':
/** * Parses a WKT PRJ String into a set of parameters. * * This is the main entry point of the parser. * * @param prjString a WKT string * @return a list of parameters * @throws PrjParserException if the PRJ cannot be parsed into a CRS for any * reason */ public Map<String, String> getParameters(String prjString) { CharBuffer s = CharBuffer.wrap(prjString); PrjElement e; try { e = parseNode(s); } catch (BufferUnderflowException ex) { throw new PrjParserException("Failed to read PRJ.", ex); } Map<String, String> prjParameters = PrjMatcher.match(e); return prjParameters; }
return new PrjNodeElement(name, parseNodeChildren(s)); } else { s.position(s.position() - 1);
log.warn("This prj file is null. \n A default srid equals to 0 will be added."); } else { PrjParser parser = new PrjParser(); String prjString = readPRJFile(prjFile); if (!prjString.isEmpty()) { Map<String, String> p = parser.getParameters(prjString); String authorityWithCode = p.get(PrjKeyParameters.REFNAME); if (authorityWithCode != null) {
log.debug("This prj file is null. \n A default srid equals to 0 will be added."); } else { PrjParser parser = new PrjParser(); String prjString = readPRJFile(prjFile); if (!prjString.isEmpty()) { Map<String, String> p = parser.getParameters(prjString); String authorityWithCode = p.get(PrjKeyParameters.REFNAME); if (authorityWithCode != null) {
/** * Creates a {@link CoordinateReferenceSystem} defined by an OGC WKT String * (PRJ). * * @param prjString the OGC WKT String defining the CRS */ public CoordinateReferenceSystem createFromPrj(String prjString) throws CRSException { PrjParser p = new PrjParser(); Map<String, String> prjParameters = p.getParameters(prjString); String name = prjParameters.remove(PrjKeyParameters.NAME); String refname = prjParameters.remove(PrjKeyParameters.REFNAME); if (refname != null) { String[] authorityNameWithKey = refname.split(":"); return CRSHelper.createCoordinateReferenceSystem(new Identifier(authorityNameWithKey[0], authorityNameWithKey[1], name), prjParameters); } else { return CRSHelper.createCoordinateReferenceSystem(new Identifier(CoordinateReferenceSystem.class, name), prjParameters); } }
log.warn("This shapefile has no prj. \n A default srid equals to 0 will be added."); } else { PrjParser parser = new PrjParser(); String prjString = readPRJFile(prjFile); if(!prjString.isEmpty()){ Map<String, String> p = parser.getParameters(prjString); String authorityWithCode = p.get(PrjKeyParameters.REFNAME); if (authorityWithCode != null) {