Commit Graph

214 Commits

Author SHA1 Message Date
Dustin Carlino
2c1c18d34a Upgrade glow 2021-03-25 15:23:13 -07:00
Dustin Carlino
ffc4f4222d Remove the old SRTM code, which has always been broken. Remove the elevation from importer config; the new approach will detect the right data source to use automatically using the bbox. #82 2021-03-18 10:14:43 -07:00
Dustin Carlino
77709a24d6 Refactor a method to asynchronously download a file on native, with a simple progress bar. #523
Use it in the updater and all the importer tools. Only place it's not
used yet is parking_mapper and the in-game updater.  [rebuild]

Also make the RunCommand state understand the control code for erasing
the current line. It... sort of works.
2021-03-15 19:51:45 -07:00
Dustin Carlino
014d3184cc Use the subprocess crate to nonblockingly read output from a command. #523 2021-03-13 14:49:01 -08:00
Dustin Carlino
c252e4a82d Grab GeoJSON from the system clipboard on native. #523 2021-03-13 12:54:14 -08:00
Dustin Carlino
27a07b02a6 Use the osmio crate to convert OSM pbf to xml, clipping it in the
process. #523

Tested really quickly, might not be working right yet. The .xml output
seems to have a duplicate '</osm>' for some reason.
2021-03-13 10:06:19 -08:00
Dustin Carlino
89f317c79d Add in normal distributions for trip departure times. #556 2021-03-05 12:24:17 -08:00
Dustin Carlino
42bd63e79b Lift URL and viewport code from game to map_gui. Also use it for OSM viewer and the 15min tool. 2021-03-04 13:22:09 -08:00
Dustin Carlino
2c0334a37d Make the map_editor read .osm directly 2021-02-20 09:31:52 -08:00
Dustin Carlino
a596cb8d04 Fix flatgeobuf dependency, which was bringing in native SSL bindings. Closes #519 2021-02-18 10:28:11 -08:00
Dustin Carlino
8d0718d37d
On the web, modify the current URL as we change maps and scenarios. (#509) 2021-02-12 15:14:09 -08:00
Dustin Carlino
a5bfa55c8e Create a tool to find the geofabrik osm.pbf file covering a particular region. Inspired by https://github.com/ropensci/osmextract. This will make importing more maps much easier, especially for cyipt/actdev#65. 2021-02-10 12:35:59 -08:00
Dustin Carlino
783ce53a4e Fix geozero patch from previous commit 2021-02-08 16:40:25 -08:00
Michael Kirk
4b665c871d
update geo related deps. (#508)
geo-types to 0.7
geo to 0.17 which removes redundant old geo used by polylabel
geojson to 0.22
2021-02-08 16:34:56 -08:00
Michael Kirk
7cd4329866
fix census driven activity model (#507)
It was failing because the version of flatgeobuf we were using was not
compatible with the recent tokio update. Now we point to the unreleased
flatgeobuf which is compatible.
2021-02-08 14:15:58 -08:00
Dustin Carlino
4235d9f994 When importing maps, optionally add in extra buildings from a GeoJSON
source to augment the ones in OSM. For
https://github.com/cyipt/actdev/issues/53 -- sometimes the buildings
just haven't been mapped in OSM yet, other times the buildings are part
of a future development site. In either case, we can procedurally
generate some houses, so this is a way to include them in the map.

Start doing this for Chapelford. But first, adjust the generated house
sizes -- they were WAY too tiny.

Also prep for [rebuild] [release]
2021-02-07 13:56:26 -08:00
Dustin Carlino
fd423439b8 Upgrade tokio, hyper, and lru 2021-02-03 18:33:06 -08:00
Dustin Carlino
73e405e382 Upgrade most dependencies 2021-02-03 18:13:06 -08:00
Dustin Carlino
c9c6f240ae Remove timer.{note, warn, error} in favor of the log crate. #262
Originally, the intention of the deleted calls was to not interrupt
Timer progress bars with warnings. But the output of things like the
importer is impossible to read anyway. Strongly considering explicitly
sending logs and timing info to separate places and using something like
multitail for live progress.

Unplumb timer from LOADS of places that just needed it for logging.
2021-01-21 19:22:02 -08:00
Dustin Carlino
e4bf32a145 Handle deleting cars live from the middle of uber-turns. #312 2021-01-19 15:43:01 -08:00
Dustin Carlino
0be06d04f9 Switch to maintained version of earcutr.
Since we have to regenerate everything anyway, also start importing
landuse=meadow areas for #449.
2021-01-14 08:29:49 -08:00
Dustin Carlino
d49c6c5d7d Refactor the logic of distributing N people to K buildings. This was
duplicated between the Berlin importer and the new census-based popdat
crate, and I suspect some form of it might get used for the actdev
integration. #424
2021-01-13 11:18:51 -08:00
Dustin Carlino
dff6d6004d On the web, use URL query parameters as the command-line arguments. This
is a step towards initializing with any map. #344

As a demo, running locally, http://0.0.0.0:8000/?--dev&--color_scheme=night%20mode now works
2021-01-09 13:02:39 -08:00
Dustin Carlino
2972fef609 Trim wasm size for #377
- Remove one of Holly's characters, since it's still unused
- Exclude assets/music

game from 54MB down to 31MB
2021-01-08 17:41:53 -08:00
Dustin Carlino
7f0cdace5a Use OpenGL to take screenshots instead of scrot. Benefits:
- Simple -- one OpenGL call and feeding to the awesome image crate
- Faster -- seemingly don't need the sleep() for whatever vsync problems
- Portable -- doesn't use the Linux scrot tool
- I can switch windows and wiggle the cursor with impunity while this runs

One disadvantage: screencaps in S3 are now slightly larger PNGs, because
for some reason, the image/gif feature is super slow, even in release
mode.

For now, this makes the process of screenshot diffing map changes
easier. But it also might help with producing raster tiles for Leaflet. #440

Also, had to regenerate lakeslice because of the previous change --
it had an old adaptive signal baked in.
2021-01-05 14:58:31 -08:00
Dustin Carlino
6f5f001406 Address SUMO PR comments and also rebase. Mainly:
- use an enum for vehicle types
- distinguish lane and internal lane IDs
2021-01-05 12:44:38 -08:00
Dustin Carlino
802e020520 Import a SUMO network, transform it into an ABST map. So far, this gets
lanes and intersections displaying, but with lots of problems.
2021-01-05 12:44:38 -08:00
Dustin Carlino
e99def9124 Switch all error handling to anyhow. Nothing consumes our code as a
library yet, so this is a step forward from string errors. Manually
tested how errors show up (including the nice with_context bit).
2021-01-05 11:35:03 -08:00
Dustin Carlino
cd7dca87d7 Fix web build after rand upgrade. Unfortunately I think this has to happen in all of the binary crates individually: https://docs.rs/getrandom/0.2.1/getrandom/#indirect-dependencies 2021-01-05 11:12:03 -08:00
Dustin Carlino
dedb041bdb Move CameraState to map_gui. Now widgetry has no dependency on abstio! #253 2021-01-04 10:39:15 -08:00
Dustin Carlino
bfa208ce6a Parameterize widgetry on a way to read SVG files. This is one of the last steps to remove the dependency on abstio. #253 2021-01-04 09:53:24 -08:00
Dustin Carlino
d529ae2e5c Upgrade usvg and rand 2021-01-04 09:19:54 -08:00
Dustin Carlino
965d999199 Upgrade misc other dependencies 2021-01-03 20:01:27 -08:00
Dustin Carlino
2945913fb3 Upgrade rand 2021-01-03 19:48:03 -08:00
Dustin Carlino
5c04923dff Split abstio crate out from abstutil. #253
widgetry, geom, and abstutil may wind up on crates.io in some form to
let other projects use widgetry. abstio has A/B Street-specific tricks
for reading data on native/web. Note widgetry still depends on abstio,
will figure out how to clean that up next.
2021-01-02 10:28:00 -08:00
Dustin Carlino
302ec94e3d Try exporting the zoomed-in rendering of a map to geojson. #440
This approach has some manual effort and it's not capturing everything
yet, but it's a start.
2021-01-01 12:46:25 -08:00
Michael Kirk
acadad8bdf
fetch US census data from a hosted FlatGeoBuf (#432) 2020-12-31 16:20:32 -08:00
Dustin Carlino
312a721e63 Fold the separate seattle_traffic_signals git repo back into this one.
Originally it was split out to organize a separate volunteer mapping
effort, but that never took off, and it's unlikely to happen. When we
have to occasionally update the prebaked signal data for some
intersections, it's unnecessary friction to update the other repo.
2020-12-31 11:01:48 -08:00
Dustin Carlino
df59b477a5 Start importing Bellevue. Treat it as a separate city from Seattle, and
don't even check if Soundcast data covers it yet.

Now regenerate all map data.
2020-12-30 13:21:59 -08:00
Dustin Carlino
64ef2f025a Restore the ability to merge short roads at the RawMap layer and in the
map_editor. It was nuked in 182f5139a5,
when I decided the MapFixes approach wasn't worth it. #114

The restored version doesn't attempt to handle turn restrictions again
yet.
2020-12-28 17:21:20 -08:00
Bruce
3be45b8221
Add a Variable phase (#433)
* Add a Variable phase

Variable provides a min duration, a delay duration, and an additional duration. The maximum cycle time is min + additional. Once min has been exhausted, if there is demand, the cycle is extended by delay until there isn't any demand or the additional duration has been consumed.

#295
2020-12-24 12:33:47 -08:00
Dustin Carlino
6642c6e1a9 Rename the experiment crate in preparation for a Monday release 2020-12-19 10:01:28 -08:00
Dustin Carlino
799adbbdd4 Fix map loader on web. Remote paths wound up with an extra /, breaking
the deduping between remote and statically bundled files, which broke
one of the map loader panels with duplicate buttons.
2020-12-19 09:51:52 -08:00
Dustin Carlino
23dea95da3 Also deploy the OSM viewer and 15 min tool to the web 2020-12-18 12:36:19 -08:00
Michael Kirk
8b9b3ce2b1
census areas import (#425)
#424
2020-12-14 17:48:47 -08:00
Dustin Carlino
3b9246860a Upgrade winit and glutin. No noticeable changes. [rebuild] 2020-12-11 20:47:00 -08:00
Dustin Carlino
7e376de03f Start transforming an abstract schedule into a specific list of trips 2020-12-10 12:28:12 -08:00
Dustin Carlino
77a37f897b Wire together a UI to generate census-based scenarios 2020-12-10 09:35:50 -08:00
Dustin Carlino
f23dacbde7 Start some skeleton code for tomorrow's hackathon 2020-12-09 22:11:05 -08:00
Dustin Carlino
6e6e975923
There's no way it's this easy to add music... (#417) 2020-12-09 13:46:27 -08:00