Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when run sample command #29

Open
LeDinhGiaHuy opened this issue May 14, 2024 · 6 comments
Open

Exception when run sample command #29

LeDinhGiaHuy opened this issue May 14, 2024 · 6 comments

Comments

@LeDinhGiaHuy
Copy link

Hi,
I got this issue when trying to get the sample output of the Melbourne city network. Below is the log, can you help me check:

`> makeNetwork(city = "Melbourne")
Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.3.1; sf_use_s2() is TRUE
── Attaching core tidyverse packages ──────────────────────────────────────────────────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package to force all conflicts to become errors
data.table 1.14.10 using 8 threads (see ?getDTthreads). Latest news: r-datatable.com

Attaching package: ‘data.table’

The following objects are masked from ‘package:lubridate’:

hour, isoweek, mday, minute, month, quarter, second, wday, week, yday, year

The following objects are masked from ‘package:dplyr’:

between, first, last

The following object is masked from ‘package:purrr’:

transpose

Attaching package: ‘igraph’

The following objects are masked from ‘package:lubridate’:

%--%, union

The following objects are masked from ‘package:dplyr’:

as_data_frame, groups, union

The following objects are masked from ‘package:purrr’:

compose, simplify

The following object is masked from ‘package:tidyr’:

crossing

The following object is masked from ‘package:tibble’:

as_data_frame

The following object is masked from ‘package:fs’:

path

The following objects are masked from ‘package:stats’:

decompose, spectrum

The following object is masked from ‘package:base’:

union

terra 1.7.76

Attaching package: ‘terra’

The following objects are masked from ‘package:igraph’:

blocks, compare

The following object is masked from ‘package:data.table’:

shift

The following object is masked from ‘package:tidyr’:

extract

Linking to liblwgeom 3.0.0beta1 r16016, GEOS 3.12.1, PROJ 9.3.1

Attaching package: ‘lwgeom’

The following object is masked from ‘package:sf’:

st_perimeter

Attaching package: ‘hablar’

The following object is masked from ‘package:forcats’:

fct

The following object is masked from ‘package:dplyr’:

na_if

The following object is masked from ‘package:tibble’:

num

Attaching package: ‘hms’

The following object is masked from ‘package:lubridate’:

hms

Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright.
Check the package website, https://docs.ropensci.org/osmextract/, for more details.
Loading required package: foreach

Attaching package: ‘foreach’

The following objects are masked from ‘package:purrr’:

accumulate, when

Loading required package: iterators
Loading required package: snow

Attaching package: ‘parallel’

The following objects are masked from ‘package:snow’:

closeNode, clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap,
clusterSplit, makeCluster, parApply, parCapply, parLapply, parRapply, parSapply, recvData, recvOneData,
sendData, splitIndices, stopCluster

2024-05-14 22:11:10.830769 | ========================================================
2024-05-14 22:11:11.919865 | Network Generation Setting
2024-05-14 22:11:11.920076 | --------------------------------------------------------
2024-05-14 22:11:11.920186 | - Downloading OSM extract: TRUE
2024-05-14 22:11:11.920291 | - Processing the OSM extract: TRUE
2024-05-14 22:11:11.920394 | - Cropping to a test area: FALSE
2024-05-14 22:11:11.920494 | - Shortest link length in network simplification: 20
2024-05-14 22:11:11.920598 | - Adding elevation: TRUE
2024-05-14 22:11:11.920694 | - Adding destination layer: TRUE
2024-05-14 22:11:11.930061 | - Adding NDVI: TRUE
2024-05-14 22:11:11.930274 | - Adding PT from GTFS: TRUE
2024-05-14 22:11:11.930428 | - Writing outputs in SQLite format: TRUE
2024-05-14 22:11:11.930569 | - Writing outputs in ShapeFile format: FALSE
2024-05-14 22:11:11.930708 | - Writing outputs in MATSim XML format: FALSE
2024-05-14 22:11:11.930898 | ========================================================
2024-05-14 22:11:11.931038 | Launching Network Generation
2024-05-14 22:11:11.931179 | --------------------------------------------------------
2024-05-14 22:11:11.931344 | Downloading OSM extract for Melbourne
Reading layer greater_melbourne' from data source C:\Users\Lenovo\Downloads\Documents\ATOM\network\data\greater_melbourne.sqlite' using driver `SQLite'
Simple feature collection with 1 feature and 10 fields
Geometry type: MULTIPOLYGON
Dimension: XY
Bounding box: xmin: 2441191 ymin: 2333183 xmax: 2577358 ymax: 2480528
Projected CRS: GDA2020 / Vicgrid
The input place was matched with Australia.
2024-05-14 22:11:12.572441 | Downloading OSM extract from https://download.geofabrik.de/australia-oceania/australia-latest.osm.pbf
The chosen file was already detected in the download directory. Skip downloading.
2024-05-14 22:11:12.573248 | Converting downloaded OSM extract to .gpkg for selected region
Error in is.null(layer) || is.na(layer) :
'length = 5' in coercion to 'logical(1)'

`

@jafshin
Copy link
Member

jafshin commented May 15, 2024

@StevePem any thoughts on this? Thanks

@StevePem
Copy link
Collaborator

StevePem commented May 15, 2024 via email

@HuyLeDinhGia
Copy link

HuyLeDinhGia commented Jun 5, 2024

Hi,
Thanks. I fixed the issue, it came from the Windows library. I got the network XML file, but the nodes are not located in Melbourne. For example: here is the first node: id=1 x="2431119" y="2441446" z="10". I don't how to get the absolute coordinates. Can you help me on this.

@StevePem
Copy link
Collaborator

StevePem commented Jun 6, 2024

Hi
Sounds like an issue with the choice of coordinate reference system (CRS). What CRS are you using? The default (set in the first few lines of NetworkGenerator.R) is GDA2020 / Vicgrid (EPSG:7899), but it can be changed.
In EPSG:7899, x="2431119" y="2441446" is a point just north of Ballan, and would probably be the western-most node in a network covering greater Melbourne, so that sounds about right.
StevePem

@HuyLeDinhGia
Copy link

Hi,
You are right, the coordinates are correct using EPSG:7899. Because I saw in the config.xml provided in the Baseline repo the setting is: <module name="global"> <param name="randomSeed" value="4711" /> <param name="coordinateSystem" value="EPSG:28355" /> <!-- global number of threads (not including mobsim): pick CPU cores --> <param name = "numberOfThreads" value="8"/> </module>

So I need to change the Matsim configuration to make sure both are the same setting, right?

Regards,
Huy

@StevePem
Copy link
Collaborator

StevePem commented Jun 7, 2024

@jafshin - could you comment on the Matsim configuration? It sounds right to me to say that yes, the configuration should use the same CRS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants