Skip to content

Conversation

@apenney
Copy link

@apenney apenney commented Feb 25, 2025

This resolved an issue I had setting up tilekiln. I'm not a lua expert, but GPT claimed this was incorrect and changing it to match what it told me fixed my issue:

❯ osm2pgsql --output flex --style shortbread.lua -d spirit ~/osm/north-america-latest.osm.pbf
2025-02-24 18:22:39  osm2pgsql version 2.0.1
2025-02-24 18:22:39  Database version: 17.2
2025-02-24 18:22:39  PostGIS version: 3.5
2025-02-24 18:22:39  ERROR: Error loading lua config: /home/apenney/git/osm2pgsql-themepark/lua/themepark.lua:246: bad argument #1 to 'read' (invalid option).

After the change:

❯ osm2pgsql --output flex --style shortbread.lua -d spirit ~/osm/north-america-latest.osm.pbf
2025-02-24 18:24:37  osm2pgsql version 2.0.1
2025-02-24 18:24:37  Database version: 17.2
2025-02-24 18:24:37  PostGIS version: 3.5
2025-02-24 18:24:37  Initializing properties table '"public"."osm2pgsql_properties"'.
2025-02-24 18:24:37  Storing properties to table '"public"."osm2pgsql_properties"'.
Processing: Node(220820k 2083.2k/s) Way(0k 0.00k/s) Relation(0 0.0/s)

@apenney apenney changed the title These file:reads need to be *a instead of a* Change file:reads to be *a instead of a* Feb 25, 2025
@joto
Copy link
Contributor

joto commented Feb 25, 2025

Looking at the Lua documentation it seems the syntax for the read command was changed from *a in Lua version 5.1 and 5.2 to just a in version 5.3 and 5.4. Those versions seems to ignore the * so everything worked for them. I guess you have version 5.1 or 5.2. Thanks for the fix.

@joto joto merged commit b54281d into osm2pgsql-dev:master Feb 25, 2025
1 check passed
@apenney
Copy link
Author

apenney commented Feb 25, 2025

Weirdly, I actually had lua 5.4.7 and that was the one causing me issues! Thanks for merging!

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.

2 participants