matsim-org / matsim-libs

Multi-Agent Transport Simulation
www.matsim.org
484 stars 447 forks source link

ESPG:31468 error #2587

Open puneetssharma opened 1 year ago

puneetssharma commented 1 year ago

Hi,

I am using version 13.x of matsim libs. I am trying to simulate the open berlin scenario plans for my case. However, I receive an error: java.lang.IllegalArgumentException: org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:31468" from authority "EPSG" found for object of type "EngineeringCRS".

Can someone help!

Thank you

Janekdererste commented 1 year ago

Hi,

could you please share the entire Stack Trace, or even better the entire log file?

puneetssharma commented 1 year ago

Please find the snippet below:

2023-05-16T13:49:30,493 WARN LinkImpl:125 length=0.0 of link id pt_0 may cause problems 2023-05-16T13:49:30,494 WARN LinkImpl:127 Future occurences of this logging statement are suppressed. 2023-05-16T13:49:30,824 INFO ScenarioLoaderImpl:171 no facilities file set in config, therefore not loading any facilities. This is not a problem except if you are using facilities 2023-05-16T13:49:30,824 INFO ScenarioLoaderImpl:187 no facility-attributes file set in config, not loading any facility attributes 2023-05-16T13:49:30,824 INFO ScenarioLoaderImpl:195 loading population from file:/home/psharma/IdeaProjects/matsim-bimodal-real-world/scenarios/Berlin_modified/output/input/population_input_1pc.xml.gz 2023-05-16T13:49:30,826 INFO MatsimXmlParser:160 starting to parse xml from url file:/home/psharma/IdeaProjects/matsim-bimodal-real-world/scenarios/Berlin_modified/output/input/population_input_1pc.xml.gz ... 2023-05-16T13:49:30,829 INFO PopulationReader:123 using population_v6-reader. 2023-05-16T13:49:30,830 INFO MatsimXmlParser:276 Trying to load http://www.matsim.org/files/dtd/population_v6.dtd. In some cases (e.g. network interface up but no connection), this may take a bit. 2023-05-16T13:49:30,853 WARN PopulationReaderMatsimV6:213 coordinate transformation defined both in config and in input file: setting from input file will be used 2023-05-16T13:49:31,001 WARN MGC:176 Assuming that coordinates are in longitude first notation, i.e. (longitude, latitude). java.lang.IllegalArgumentException: org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:31468" from authority "EPSG" found for object of type "EngineeringCRS". at org.matsim.core.utils.geometry.geotools.MGC.getCRS(MGC.java:179) at org.matsim.core.utils.geometry.transformations.GeotoolsTransformation.<init>(GeotoolsTransformation.java:56) at org.matsim.core.utils.geometry.transformations.TransformationFactory.getCoordinateTransformation(TransformationFactory.java:81) at org.matsim.core.population.io.PopulationReaderMatsimV6.endTag(PopulationReaderMatsimV6.java:215) at org.matsim.core.population.io.PopulationReader.endTag(PopulationReader.java:101) at org.matsim.core.utils.io.MatsimXmlParser.endElement(MatsimXmlParser.java:358) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:610) at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator.endNamespaceScope(XMLNSDTDValidator.java:226) at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1934) at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:865) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1718) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2883) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216) at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635) at org.matsim.core.utils.io.MatsimXmlParser.parse(MatsimXmlParser.java:194) at org.matsim.core.utils.io.MatsimXmlParser.parse(MatsimXmlParser.java:164) at org.matsim.core.scenario.ScenarioLoaderImpl.loadPopulation(ScenarioLoaderImpl.java:202) at org.matsim.core.scenario.ScenarioLoaderImpl.loadScenario(ScenarioLoaderImpl.java:115) at org.matsim.core.scenario.ScenarioUtils.loadScenario(ScenarioUtils.java:91) at org.matsim.contrib.drt.run.DrtControlerCreator.createControler(DrtControlerCreator.java:67) at de.mpi.ds.MatsimMain.run(MatsimMain.java:290) at de.mpi.ds.MatsimMain.runRealWorld(MatsimMain.java:152) at de.mpi.ds.MatsimMain.main(MatsimMain.java:59) Caused by: org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:31468" from authority "EPSG" found for object of type "EngineeringCRS". at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.noSuchAuthorityException(CartesianAuthorityFactory.java:136) at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.createEngineeringCRS(CartesianAuthorityFactory.java:128) at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.createCoordinateReferenceSystem(CartesianAuthorityFactory.java:119) at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:779) at org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:635) at org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:176) at org.geotools.referencing.CRS.decode(CRS.java:517)

puneetssharma commented 1 year ago

Hi, Can someone please help?

kainagel commented 1 year ago

This is a geotools problem, not a matsim problem. There is a fair amount of discussion here: https://github.com/matsim-org/pt2matsim/issues/135 . Not sure if this is conclusive; in the end it says one should use a newer geotools. However, changing the geotools version yourself while sticking with your version of matsim probably will cause other problems. Using a newer version of MATSim would be good, but no guarantee that this will fix the issue.

In your case, you could also try using "GK4" instead of "EPSG:31468" (wherever you are using this). Not sure if that still works but "GK4" used to be hard-coded, and thus not go through the geotools query.