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

Include some spanish regions #503

Merged
merged 3 commits into from
Feb 16, 2022
Merged

Include some spanish regions #503

merged 3 commits into from
Feb 16, 2022

Conversation

Crashillo
Copy link
Contributor

Features and resources (telegram & wiki)

  • Castile and Leon
  • Madrid
  • Valencian Community

It also includes a slight refactor of the spain resource names to organise them properly.

Caveats

npm run test is failing checking the features, but I cannot figure out why.

πŸ—   Building data...
πŸ“¦  Defaults: βœ“ 1
πŸ“¦  Features: βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“βœ“/home/hugo/Proyectos/osm-community-index/node_modules/@mapbox/geojson-area/index.js:8
    switch (_.type) {
              ^

TypeError: Cannot read property 'type' of undefined
    at Object.geometry (/home/hugo/Proyectos/osm-community-index/node_modules/@mapbox/geojson-area/index.js:8:15)
    at file:///home/hugo/Proyectos/osm-community-index/scripts/build_index.js:128:28
    at Array.forEach (<anonymous>)
    at collectFeatures (file:///home/hugo/Proyectos/osm-community-index/scripts/build_index.js:102:49)
    at buildAll (file:///home/hugo/Proyectos/osm-community-index/scripts/build_index.js:54:15)
    at file:///home/hugo/Proyectos/osm-community-index/scripts/build_index.js:39:1
    at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
    at async Loader.import (internal/modules/esm/loader.js:177:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)

@bhousel
Copy link
Member

bhousel commented Feb 15, 2022

npm run test is failing checking the features, but I cannot figure out why.

It looks like the new geojsons files are not formed properly..

@Crashillo
Copy link
Contributor Author

Oh, I see. GeometryCollection is not supported. Gotcha

@Crashillo
Copy link
Contributor Author

I still unable to pass the tests :( As you may see the files are features now, but I'm facing two different errors:

For node 14.x the same I pasted in the OP, and for node 16.x:

> osm-community-index@5.1.5 build:index
> node scripts/build_index.js

node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///Users/hugo/populate/osm-community-index/schema/geojson.json" needs an import assertion of type "json"
    at new NodeError (node:internal/errors:371:5)
    at validateAssertions (node:internal/modules/esm/assert:82:15)
    at defaultLoad (node:internal/modules/esm/load:24:3)
    at ESMLoader.load (node:internal/modules/esm/loader:359:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:280:58)
    at new ModuleJob (node:internal/modules/esm/module_job:66:26)
    at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:297:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:261:34)
    at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:81:21)
    at async Promise.all (index 18) {
  code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'
}
ERROR: "build:index" exited with 1.
ERROR: "build" exited with 1.

@bhousel
Copy link
Member

bhousel commented Feb 15, 2022

code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'

ohh yeah if you are seeing errors about import assertions, you're probably using node 17.. Can you try again with node 16?

@Crashillo
Copy link
Contributor Author

That test was using v16.14.0

@Crashillo
Copy link
Contributor Author

From v16.13 downwards, I get the same OP error

@bhousel
Copy link
Member

bhousel commented Feb 16, 2022

From v16.13 downwards, I get the same OP error

Ok thanks for letting me know.. That's really disappointing that node did this 😠

I'll have to see if there is a way to import .json files that works across all the LTS versions.

@bhousel
Copy link
Member

bhousel commented Feb 16, 2022

I ended up just adding the assert {type: 'json'}; to everywhere that we import json and raising the minimum version of node for the project. Thanks for the PR and letting me know about the issue with node!

@bhousel bhousel merged commit 345274c into osmlab:main Feb 16, 2022
@bhousel
Copy link
Member

bhousel commented Feb 16, 2022

FYI I'm going to redraw the geojsons, since they are really too detailed for this project..

Screen Shot 2022-02-16 at 12 23 10 PM

bhousel added a commit that referenced this pull request Feb 16, 2022
@Crashillo
Copy link
Contributor Author

I'm noticing missing translations on iD, why is that? I just copy another resource files

imagen

@bhousel
Copy link
Member

bhousel commented Feb 27, 2022

I'm noticing missing translations on iD, why is that? I just copy another resource files

I don't know.. another bug in iD I guess 🀷

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

Successfully merging this pull request may close these issues.

None yet

2 participants