Git Product home page Git Product logo

hot-osm-population's Introduction

HOTOSM WorldPop vs OSM Coverage

This projects trains a model of population from WorldPop raster vs OSM building footprint from MapBox QA tiles in order to generate estimates of completeness for OSM building coverage.

Building

This project uses Apache Spark and is expected to be run through spark-submit command line tool.

In order to generate the assembly .jar file required for this tool the following command is used:

./sbt assembly

This will bootstrap the Scala Build Tool and built the assembly and requires only java version 1.8 to be available.

Running

Project defines multiple main files, for training a model of OSM based on WorldPop raster and for predicting OSM coverage based on trained model. They can be called through spark-submit as follows:

spark-submit --master "local[*]" --driver-memory 4G \
    --class com.azavea.hotosmpopulation.TrainApp \
    target/scala-2.11/hot-osm-population-assembly.jar \
    --country botswana \
    --worldpop file:/hot-osm/WorldPop/BWA15v4.tif \
    --qatiles /hot-osm/mbtiles/botswana.mbtiles \
    --model /hot-osm/models/botswana-regression

spark-submit --master "local[*]" --driver-memory 4G \
    --class com.azavea.hotosmpopulation.PredictApp \
    target/scala-2.11/hot-osm-population-assembly.jar \
    --country botswana \
    --worldpop file:/hot-osm/WorldPop/BWA15v4.tif \
    --qatiles /hot-osm/mbtiles/botswana.mbtiles \
    --model /hot-osm/models/botswana-regression \
    --output /hot-osm/botswana.json

The arguments appearing before the hot-osm-population-assembly.jar are to spark-submit command. The arguments appearing after the JAR are specific to the application:

country: ADM0_A3 country code or name, used to lookup country boundary worldpop: URI to WorldPop raster, maybe file:/ or s3:// scheme. qatiles: Path to MapBox QA .mbtiles file for the country, must be local. model: Path to save/load model directory, is must be local. output: Path to generate prediction JSON output, must be local.

For development the train and predict commands can are scripted through the Makefile:

make train WORKDIR=/hot-osm
make predict WORKDIR=/hot-osm

prediction.json

Because WorldPop and OSM have radically different resolutions for comparison to be valid they need to be aggregated to a common resolution. Specifically WorldPop will identify population centers and evenly spread estimated population for that center over each pixel. Whereas OSM building footprints are quite resolute and are covered can vary from pixel to pixel on 100m per pixel raster.

Experimentally we see that aggregating the results per tile at zoom level 12 on WebMercator TMS layout produces visually useful relationship.

The output of model prediction is saved as JSON where a record exist for every zoom level 12 TMS tile covering the country. The key is "{zoom}/{column}/{row}" following TMS endpoint convention.

{
    "12/2337/2337": {
        "index": 1.5921462086435942,
        "actual": {
            "pop_sum": 14.647022571414709,
            "osm_sum": 145.48814392089844,
            "osm_avg": 72.74407196044922
        },
        "prediction": {
            "osm_sum": 45872.07371520996,
            "osm_avg": 45.68931644941231
        }
    }
}

Units are: pop: estimated population osm: square meters of building footprint

Why _sum and _avg? While visually the results are aggregated to one result per zoom 12 tile, training and prediction is happening at 16x16 pixels per zoom 12 tile. At this cell size there is enough smoothing between WorldPop and OSM to start building regressions.

index is computed as (predicted - actual) / predicted, it will:

  • show negative for areas with low OSM coverage for WorldPop population coverage
  • show positive for areas with OSM coverage greater than WorldPop population coverage
  • stay close to 0 where the ratio of OSM/WorldPop coverage is average

Docker

Docker images suitable for AWS Batch can be built and pushed to ECR using:

make docker
aws ecr get-login --no-include-email --region us-east-1 --profile hotosm
docker login -u AWS ... # copied from output of above command
make push-ecr ECR_REPO=670261699094.dkr.ecr.us-east-1.amazonaws.com/hotosm-population:latest

The ENTRYPOINT for docker images is docker/task.sh which handles the setup for the job. Note that task.sh uses positional arguments where all file references may refer use s3:// scheme.

The three arguments are are required in order:

  • COMMAND: train or predict
  • COUNTRY: Country name to download mbtiles
  • WORLDPOP: Name of WorldPop tiff or S3 URI to WorldPop tiff

The container may be run locally with:

docker run -it --rm -v ~/.aws:/root/.aws hotosm-population predict botswana s3://bucket/WorldPop/BWA15v4.tif
# OR
docker run -it --rm -v ~/.aws:/root/.aws hotosm-population predict botswana BWA15v4.tif

Methodology

Our core problem is to estimate the completeness of Open Street Map coverage of building footprints in areas where the map is known to be incomplete. In order to produce that expectation we need to correlate OSM building footprints with another data set. We assume population to be the driving factor for building construction so we use WorldPop as the independent variable.
Thus we're attempting to derive a relationship between population and building area used by that population.

OpenStreetMap

OSM geometries are sourced from MapBox OSM QA tiles. They are rasterized to a layer with CellSize(38.2185,38.2185) in Web Mercator projection, EPSG:3857. This resolution corresponds to TMS zoom level 15 with 256x256 pixel tiles. The cell value is the area of the building footprint that intersects pixel footprint in square meters. If multiple buildings overlap a single pixel their footprints are combined.

At this raster resolution resulting pixels cover buildings with sufficient precision:

Satellite Rasterized Buildings
screen shot 2018-04-30 at 10 43 47 am screen shot 2018-04-30 at 10 43 29 am

WorldPop

WorldPop raster is provided in EPSG:4326 with CellSize(0.0008333, 0.0008333), this is close to 100m at equator. Because we're going to be predicting and reporting in EPSG:3857 we reproject the raster using SUM resample method, aggregating population density values.

Comparing WorldPop to OSM for Nata, Batswana reveals a problem:

WorldPop WorldPop + OSM OSM + Satellite
screen shot 2018-04-30 at 10 41 22 am screen shot 2018-04-30 at 10 41 39 am screen shot 2018-04-30 at 10 42 02 am

Even though WorldPop raster resolution is ~100m the population density is spread evenly at 8.2 ppl/pixel for the blue area. This makes it difficult to find relation between individual pixel of population and building area, which ranges from 26 to 982 in this area alone. The conclusion is that we must aggregate both population and building area to the point where they share resolution and aggregate trend may emerge.

Plotting a sample of population vs building area we see this as stacks of multiple area values for single population area: screen shot 2018-04-30 at 3 53 20 pm

Its until we reduce aggregate all values at TMS zoom 17 that a clear trend emerges: screen shot 2018-04-26 at 1 41 09 pm

Finding line of best fit for gives us 6.5 square meters of building footprint per person in Botswana with R-squared value of 0.88069. Aggregating to larger areas does not significantly change the fit or the slope of the line.

Data Quality

Following data quality issues have been encountered and considered:

Estimates of WorldPop population depend on administrative census data. These estimates data varies in quality and recency from country to country. To avoid training on data from various sources we fit a model per country where sources are most likely to be consistent, rather than larger areas.

WorldPop and OSM are updated at different intervals and do not share coverage. This leads to following problems:

  • Regions in WorldPop showing population that are not covered by OSM
  • Regions in OSM showing building footprints not covered by WorldPop
  • Incomplete OSM coverage per Region

To address above concerns we mark regions where OSM/WorldPop relation appears optimal, this allows us to compare other areas and reveal the above problems using the derived model. For further discussion and examples see training set documentation.

Workflow

Overall workflow as follows:

Preparation

  • Read WorldPop raster for country
  • Reproject WorldPop to EPSG:3857 TMS Level 15 at 256x256 pixel tiles.
  • Rasterize OSM building footprints to EPSG:3857 TMS Level 15 at 256x256 pixel tiles.
  • Aggregate both population and building area to 4x4 tile using SUM resample method.

Training

  • Mask WorldPop and OSM raster by training set polygons.
  • Set all OSM NODATA cell values to 0.0.
  • Fit and save LinearRegressionModel to population vs. building area.
    • Fix y-intercept at '0.0'.

Prediction

  • Apply LinearRegressionModel to get expected building area.
  • Sum all of 4x4 pixel in a tile.
  • Report
    • Total population
    • Actual building area
    • Expected building area
    • Completeness index as (actual area - expect area) / expected area

Because the model is derived from well labeled areas which we expect it to be stable in describing the usage building space per country. This enables us to re-run the prediction process with updated OSM input and track changes in OSM coverage.

hot-osm-population's People

Contributors

echeipesh avatar jpolchlo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hot-osm-population's Issues

Error when running the train command

+ set -e
+ BUCKET=hotosm-population
+ COMMAND=train
+ COUNTRY=zambia
+ WORLDPOP=s3://hotosm-population/WorldPop/ZMB_ppp_v2c_2020_UNadj.tif
+ [[ s3://hotosm-population/WorldPop/ZMB_ppp_v2c_2020_UNadj.tif == s3* ]]
+ WORLDPOP_URI=s3://hotosm-population/WorldPop/ZMB_ppp_v2c_2020_UNadj.tif
+ OSM_QA_URI=https://s3.amazonaws.com/mapbox/osm-qa-tiles-production/latest.country/zambia.mbtiles.gz
+ MODEL_URI=s3://hotosm-population/models/zambia-regression/
+ OUTPUT_URI=s3://hotosm-population/predict/zambia.json
+ TRAINING_URI=s3://hotosm-population/training/zambia.json
+ gunzip
+ curl -o - https://s3.amazonaws.com/mapbox/osm-qa-tiles-production/latest.country/zambia.mbtiles.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
4 91.6M 4 4401k 0 0 21.6M 0 0:00:04 --:--:-- 0:00:04 21.6M
44 91.6M 44 40.9M 0 0 34.1M 0 0:00:02 0:00:01 0:00:01 34.1M
96 91.6M 96 88.0M 0 0 39.9M 0 0:00:02 0:00:02 --:--:-- 39.9M
100 91.6M 100 91.6M 0 0 40.6M 0 0:00:02 0:00:02 --:--:-- 40.6M
+ JAR=/hot-osm-population-assembly.jar
+ shopt -s nocasematch
+ case ${COMMAND} in
+ aws s3 cp s3://hotosm-population/training/zambia.json /task/training-set.json
Completed 6.8 KiB/6.8 KiB (94.9 KiB/s) with 1 file(s) remaining
download: s3://hotosm-population/training/zambia.json to ./training-set.json
+ /opt/spark/bin/spark-submit --master 'local[*]' --driver-memory 7G --class com.azavea.hotosmpopulation.LabeledTrainApp /hot-osm-population-assembly.jar --country zambia --worldpop s3://hotosm-population/WorldPop/ZMB_ppp_v2c_2020_UNadj.tif --training /task/training-set.json --model /task/model --qatiles /task/zambia.mbtiles
Spark Configuration:
(spark.driver.memory,7G)
(spark.app.name,WorldPop-OSM-Train)
(spark.driver.host,172.31.4.116)
(spark.driver.maxResultSize,2G)
(spark.app.id,local-1543844579993)
(spark.ui.enabled,true)
(spark.master,local[*])
(spark.executor.id,driver)
(spark.driver.port,36047)
(spark.submit.deployMode,client)
(spark.jars,file:/hot-osm-population-assembly.jar)
Using 0 training polygons

[Stage 1:> (0 + 4) / 83]
[Stage 1:> (0 + 4) / 83]
[Stage 1:> (1 + 4) / 83]
[Stage 1:==> (3 + 4) / 83]
[Stage 1:==> (4 + 4) / 83]
[Stage 1:==> (4 + 4) / 83]
[Stage 1:===> (5 + 4) / 83]
[Stage 1:====> (6 + 4) / 83]
[Stage 1:====> (7 + 4) / 83]
[Stage 1:=====> (8 + 4) / 83]
[Stage 1:=====> (8 + 4) / 83]
[Stage 1:======> (9 + 4) / 83]
[Stage 1:======> (10 + 4) / 83]
[Stage 1:=======> (11 + 4) / 83]
[Stage 1:========> (12 + 4) / 83]
[Stage 1:========> (12 + 4) / 83]
[Stage 1:========> (13 + 4) / 83]
[Stage 1:=========> (14 + 4) / 83]
[Stage 1:==========> (15 + 4) / 83]
[Stage 1:==========> (16 + 4) / 83]
[Stage 1:==========> (16 + 4) / 83]
[Stage 1:===========> (17 + 4) / 83]
[Stage 1:============> (18 + 4) / 83]
[Stage 1:=============> (19 + 4) / 83]
[Stage 1:=============> (20 + 4) / 83]
[Stage 1:=============> (20 + 4) / 83]
[Stage 1:==============> (21 + 4) / 83]
[Stage 1:===============> (22 + 4) / 83]
[Stage 1:===============> (23 + 4) / 83]
[Stage 1:================> (24 + 4) / 83]
[Stage 1:================> (24 + 4) / 83]
[Stage 1:=================> (25 + 4) / 83]
[Stage 1:=================> (26 + 4) / 83]
[Stage 1:==================> (27 + 4) / 83]
[Stage 1:===================> (28 + 4) / 83]
[Stage 1:===================> (28 + 4) / 83]
[Stage 1:===================> (29 + 4) / 83]
[Stage 1:====================> (30 + 4) / 83]
[Stage 1:=====================> (31 + 4) / 83]
[Stage 1:=====================> (32 + 4) / 83]
[Stage 1:=====================> (32 + 4) / 83]
[Stage 1:======================> (33 + 4) / 83]
[Stage 1:=======================> (34 + 4) / 83]
[Stage 1:========================> (35 + 4) / 83]
[Stage 1:========================> (36 + 4) / 83]
[Stage 1:========================> (36 + 4) / 83]
[Stage 1:=========================> (37 + 4) / 83]
[Stage 1:==========================> (38 + 4) / 83]
[Stage 1:==========================> (39 + 4) / 83]
[Stage 1:===========================> (40 + 4) / 83]
[Stage 1:===========================> (40 + 4) / 83]
[Stage 1:============================> (41 + 4) / 83]
[Stage 1:============================> (42 + 4) / 83]
[Stage 1:=============================> (43 + 4) / 83]
[Stage 1:==============================> (44 + 4) / 83]
[Stage 1:==============================> (44 + 4) / 83]
[Stage 1:==============================> (45 + 4) / 83]
[Stage 1:===============================> (46 + 4) / 83]
[Stage 1:================================> (47 + 4) / 83]
[Stage 1:================================> (48 + 4) / 83]
[Stage 1:=================================> (49 + 4) / 83]
[Stage 1:==================================> (50 + 4) / 83]
[Stage 1:===================================> (51 + 4) / 83]
[Stage 1:===================================> (52 + 4) / 83]
[Stage 1:====================================> (53 + 4) / 83]
[Stage 1:=====================================> (54 + 4) / 83]
[Stage 1:=====================================> (55 + 4) / 83]
[Stage 1:======================================> (56 + 4) / 83]
[Stage 1:=======================================> (57 + 4) / 83]
[Stage 1:=======================================> (58 + 4) / 83]
[Stage 1:========================================> (59 + 4) / 83]
[Stage 1:=========================================> (60 + 4) / 83]
[Stage 1:=========================================> (61 + 4) / 83]
[Stage 1:==========================================> (62 + 4) / 83]
[Stage 1:===========================================> (63 + 4) / 83]
[Stage 1:===========================================> (64 + 4) / 83]
[Stage 1:============================================> (65 + 4) / 83]
[Stage 1:=============================================> (66 + 4) / 83]
[Stage 1:==============================================> (67 + 4) / 83]
[Stage 1:==============================================> (68 + 4) / 83]
[Stage 1:===============================================> (69 + 4) / 83]
[Stage 1:================================================> (70 + 4) / 83]
[Stage 1:================================================> (71 + 4) / 83]
[Stage 1:=================================================> (72 + 4) / 83]
[Stage 1:==================================================> (73 + 4) / 83]
[Stage 1:==================================================> (74 + 4) / 83]
[Stage 1:===================================================> (75 + 4) / 83]
[Stage 1:====================================================> (76 + 4) / 83]
[Stage 1:====================================================> (77 + 4) / 83]
[Stage 1:=====================================================> (78 + 4) / 83]
[Stage 1:======================================================> (79 + 4) / 83]
[Stage 1:======================================================> (80 + 3) / 83]
[Stage 1:=======================================================> (81 + 2) / 83]
[Stage 1:========================================================>(82 + 1) / 83]


[Stage 4:> (1 + 4) / 83]
[Stage 4:=> (2 + 4) / 83]
[Stage 4:==> (3 + 4) / 83]
[Stage 4:==> (4 + 4) / 83]
[Stage 4:===> (5 + 4) / 83]
[Stage 4:====> (6 + 4) / 83]
[Stage 4:====> (7 + 4) / 83]
[Stage 4:=====> (8 + 4) / 83]
[Stage 4:======> (9 + 4) / 83]
[Stage 4:======> (10 + 4) / 83]
[Stage 4:=======> (11 + 4) / 83]
[Stage 4:========> (12 + 4) / 83]
[Stage 4:========> (13 + 4) / 83]
[Stage 4:=========> (14 + 4) / 83]
[Stage 4:==========> (15 + 4) / 83]
[Stage 4:==========> (16 + 4) / 83]
[Stage 4:===========> (17 + 4) / 83]
[Stage 4:============> (18 + 4) / 83]
[Stage 4:=============> (19 + 4) / 83]
[Stage 4:=============> (20 + 4) / 83]
[Stage 4:==============> (21 + 4) / 83]
[Stage 4:===============> (22 + 4) / 83]
[Stage 4:===============> (23 + 4) / 83]
[Stage 4:================> (24 + 4) / 83]
[Stage 4:=================> (25 + 4) / 83]
[Stage 4:=================> (26 + 4) / 83]
[Stage 4:==================> (27 + 4) / 83]
[Stage 4:===================> (28 + 4) / 83]
[Stage 4:===================> (29 + 4) / 83]
[Stage 4:====================> (30 + 4) / 83]
[Stage 4:=====================> (31 + 4) / 83]
[Stage 4:=====================> (32 + 4) / 83]
[Stage 4:======================> (33 + 4) / 83]
[Stage 4:=======================> (34 + 4) / 83]
[Stage 4:========================> (35 + 4) / 83]
[Stage 4:========================> (36 + 4) / 83]
[Stage 4:=========================> (37 + 4) / 83]
[Stage 4:==========================> (38 + 4) / 83]
[Stage 4:==========================> (39 + 4) / 83]
[Stage 4:===========================> (40 + 4) / 83]
[Stage 4:============================> (41 + 4) / 83]
[Stage 4:============================> (42 + 4) / 83]
[Stage 4:=============================> (43 + 4) / 83]
[Stage 4:==============================> (44 + 4) / 83]
[Stage 4:==============================> (45 + 4) / 83]
[Stage 4:===============================> (46 + 4) / 83]
[Stage 4:================================> (47 + 4) / 83]
[Stage 4:================================> (48 + 4) / 83]
[Stage 4:=================================> (49 + 4) / 83]
[Stage 4:==================================> (50 + 4) / 83]
[Stage 4:===================================> (51 + 4) / 83]
[Stage 4:===================================> (52 + 4) / 83]
[Stage 4:====================================> (53 + 4) / 83]
[Stage 4:=====================================> (54 + 4) / 83]
[Stage 4:=====================================> (55 + 4) / 83]
[Stage 4:======================================> (56 + 4) / 83]
[Stage 4:=======================================> (57 + 4) / 83]
[Stage 4:=======================================> (58 + 4) / 83]
[Stage 4:========================================> (59 + 4) / 83]
[Stage 4:=========================================> (61 + 4) / 83]
[Stage 4:==========================================> (62 + 4) / 83]
[Stage 4:===========================================> (63 + 4) / 83]
[Stage 4:===========================================> (64 + 4) / 83]
[Stage 4:============================================> (65 + 4) / 83]
[Stage 4:=============================================> (66 + 4) / 83]
[Stage 4:==============================================> (67 + 4) / 83]
[Stage 4:==============================================> (68 + 4) / 83]
[Stage 4:===============================================> (69 + 4) / 83]18/12/03 14:40:24 ERROR Executor: Exception in task 72.0 in stage 4.0 (TID 157)
org.apache.spark.SparkException: Failed to execute user defined function(anonfun$2: (int, int) => rf_tile)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source)
at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
at org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$8$$anon$1.hasNext(WholeStageCodegenExec.scala:395)
at org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1.next(InMemoryRelation.scala:100)
at org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1.next(InMemoryRelation.scala:92)
at org.apache.spark.storage.memory.MemoryStore.putIteratorAsBytes(MemoryStore.scala:372)
at org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:1055)
at org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:1029)
at org.apache.spark.storage.BlockManager.doPut(BlockManager.scala:969)
at org.apache.spark.storage.BlockManager.doPutIterator(BlockManager.scala:1029)
at org.apache.spark.storage.BlockManager.getOrElseUpdate(BlockManager.scala:760)
at org.apache.spark.rdd.RDD.getOrCompute(RDD.scala:334)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:285)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
at org.apache.spark.scheduler.Task.run(Task.scala:108)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Rasterizer encountered an error: an odd number of X axis intersections encountered via a horizontal line across the raster at y = 54.
at geotrellis.raster.rasterize.polygon.PolygonRasterizer$.foreachCellByPolygon(PolygonRasterizer.scala:431)
at geotrellis.raster.rasterize.polygon.FractionalRasterizer$.foreachCellByPolygon(FractionalRasterizer.scala:185)
at com.azavea.hotosmpopulation.FootprintGenerator$$anonfun$apply$2.apply(FootprintGenerator.scala:105)
at com.azavea.hotosmpopulation.FootprintGenerator$$anonfun$apply$2.apply(FootprintGenerator.scala:103)
at scala.collection.immutable.Stream.foreach(Stream.scala:594)
at com.azavea.hotosmpopulation.FootprintGenerator.apply(FootprintGenerator.scala:103)
at com.azavea.hotosmpopulation.OSM$$anonfun$2.apply(OSM.scala:71)
at com.azavea.hotosmpopulation.OSM$$anonfun$2.apply(OSM.scala:70)
... 44 more
18/12/03 14:40:24 ERROR TaskSetManager: Task 72 in stage 4.0 failed 1 times; aborting job
Exception in thread "main" org.apache.spark.SparkException: Job aborted due to stage failure: Task 72 in stage 4.0 failed 1 times, most recent failure: Lost task 72.0 in stage 4.0 (TID 157, localhost, executor driver): org.apache.spark.SparkException: Failed to execute user defined function(anonfun$2: (int, int) => rf_tile)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source)
at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
at org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$8$$anon$1.hasNext(WholeStageCodegenExec.scala:395)
at org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1.next(InMemoryRelation.scala:100)
at org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1.next(InMemoryRelation.scala:92)
at org.apache.spark.storage.memory.MemoryStore.putIteratorAsBytes(MemoryStore.scala:372)
at org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:1055)
at org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:1029)
at org.apache.spark.storage.BlockManager.doPut(BlockManager.scala:969)
at org.apache.spark.storage.BlockManager.doPutIterator(BlockManager.scala:1029)
at org.apache.spark.storage.BlockManager.getOrElseUpdate(BlockManager.scala:760)
at org.apache.spark.rdd.RDD.getOrCompute(RDD.scala:334)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:285)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
at org.apache.spark.scheduler.Task.run(Task.scala:108)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Rasterizer encountered an error: an odd number of X axis intersections encountered via a horizontal line across the raster at y = 54.
at geotrellis.raster.rasterize.polygon.PolygonRasterizer$.foreachCellByPolygon(PolygonRasterizer.scala:431)
at geotrellis.raster.rasterize.polygon.FractionalRasterizer$.foreachCellByPolygon(FractionalRasterizer.scala:185)
at com.azavea.hotosmpopulation.FootprintGenerator$$anonfun$apply$2.apply(FootprintGenerator.scala:105)
at com.azavea.hotosmpopulation.FootprintGenerator$$anonfun$apply$2.apply(FootprintGenerator.scala:103)
at scala.collection.immutable.Stream.foreach(Stream.scala:594)
at com.azavea.hotosmpopulation.FootprintGenerator.apply(FootprintGenerator.scala:103)
at com.azavea.hotosmpopulation.OSM$$anonfun$2.apply(OSM.scala:71)
at com.azavea.hotosmpopulation.OSM$$anonfun$2.apply(OSM.scala:70)
... 44 more
Driver stacktrace:
at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1517)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1505)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1504)
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1504)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:814)
at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:814)
at scala.Option.foreach(Option.scala:257)
at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:814)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:1732)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1687)
at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1676)
at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:48)
at org.apache.spark.scheduler.DAGScheduler.runJob(DAGScheduler.scala:630)
at org.apache.spark.SparkContext.runJob(SparkContext.scala:2029)
at org.apache.spark.SparkContext.runJob(SparkContext.scala:2126)
at org.apache.spark.rdd.RDD$$anonfun$reduce$1.apply(RDD.scala:1026)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
at org.apache.spark.rdd.RDD.withScope(RDD.scala:362)
at org.apache.spark.rdd.RDD.reduce(RDD.scala:1008)
at org.apache.spark.rdd.RDD$$anonfun$treeAggregate$1.apply(RDD.scala:1151)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
at org.apache.spark.rdd.RDD.withScope(RDD.scala:362)
at org.apache.spark.rdd.RDD.treeAggregate(RDD.scala:1128)
at org.apache.spark.ml.optim.WeightedLeastSquares.fit(WeightedLeastSquares.scala:100)
at org.apache.spark.ml.regression.LinearRegression.train(LinearRegression.scala:220)
at org.apache.spark.ml.regression.LinearRegression.train(LinearRegression.scala:76)
at org.apache.spark.ml.Predictor.fit(Predictor.scala:118)
at com.azavea.hotosmpopulation.LabeledTrainApp$$anonfun$$lessinit$greater$1.apply(LabeledTrainApp.scala:109)
at com.azavea.hotosmpopulation.LabeledTrainApp$$anonfun$$lessinit$greater$1.apply(LabeledTrainApp.scala:51)
at cats.SemigroupalArityFunctions$$anonfun$map5$1.apply(SemigroupalArityFunctions.scala:75)
at cats.SemigroupalArityFunctions$$anonfun$map5$1.apply(SemigroupalArityFunctions.scala:75)
at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:52)
at cats.data.Validated.ap(Validated.scala:172)
at cats.data.ValidatedApplicative.ap(Validated.scala:509)
at cats.data.ValidatedApplicative.ap(Validated.scala:502)
at cats.ComposedApply$$anonfun$ap$1$$anonfun$apply$1.apply(Composed.scala:33)
at cats.Monad$$anonfun$map$1.apply(Monad.scala:16)
at cats.instances.Function0Instances$$anon$1$$anonfun$flatMap$1.apply(function.scala:24)
at cats.instances.Function0Instances$$anon$1$$anonfun$flatMap$1.apply(function.scala:24)
at cats.instances.Function0Instances$$anon$1$$anonfun$flatMap$1.apply(function.scala:24)
at com.monovore.decline.Parser.com$monovore$decline$Parser$$evalResult(Parser.scala:26)
at com.monovore.decline.Parser.consumeAll(Parser.scala:91)
at com.monovore.decline.Parser.apply(Parser.scala:17)
at com.monovore.decline.Command.parse(opts.scala:17)
at com.monovore.decline.CommandApp.main(CommandApp.scala:48)
at com.azavea.hotosmpopulation.LabeledTrainApp.main(LabeledTrainApp.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:775)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:119)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: org.apache.spark.SparkException: Failed to execute user defined function(anonfun$2: (int, int) => rf_tile)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source)
at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
at org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$8$$anon$1.hasNext(WholeStageCodegenExec.scala:395)
at org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1.next(InMemoryRelation.scala:100)
at org.apache.spark.sql.execution.columnar.InMemoryRelation$$anonfun$1$$anon$1.next(InMemoryRelation.scala:92)
at org.apache.spark.storage.memory.MemoryStore.putIteratorAsBytes(MemoryStore.scala:372)
at org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:1055)
at org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:1029)
at org.apache.spark.storage.BlockManager.doPut(BlockManager.scala:969)
at org.apache.spark.storage.BlockManager.doPutIterator(BlockManager.scala:1029)
at org.apache.spark.storage.BlockManager.getOrElseUpdate(BlockManager.scala:760)
at org.apache.spark.rdd.RDD.getOrCompute(RDD.scala:334)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:285)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
at org.apache.spark.scheduler.Task.run(Task.scala:108)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:338)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Rasterizer encountered an error: an odd number of X axis intersections encountered via a horizontal line across the raster at y = 54.
at geotrellis.raster.rasterize.polygon.PolygonRasterizer$.foreachCellByPolygon(PolygonRasterizer.scala:431)
at geotrellis.raster.rasterize.polygon.FractionalRasterizer$.foreachCellByPolygon(FractionalRasterizer.scala:185)
at com.azavea.hotosmpopulation.FootprintGenerator$$anonfun$apply$2.apply(FootprintGenerator.scala:105)
at com.azavea.hotosmpopulation.FootprintGenerator$$anonfun$apply$2.apply(FootprintGenerator.scala:103)
at scala.collection.immutable.Stream.foreach(Stream.scala:594)
at com.azavea.hotosmpopulation.FootprintGenerator.apply(FootprintGenerator.scala:103)
at com.azavea.hotosmpopulation.OSM$$anonfun$2.apply(OSM.scala:71)
at com.azavea.hotosmpopulation.OSM$$anonfun$2.apply(OSM.scala:70)
... 44 more

error in make docker

First I had a problem to install the geotrellis packages, so I uncommented the snapshot repository and I was able to install it.

But then when running make docker I had this error:

[wille@sailboat hot-osm-population]$ make docker
./sbt assembly
[info] Loading project definition from /home/wille/projetos/HOT/hot-osm-population/project
[info] Set current project to hotosmpopulation (in build file:/home/wille/projetos/HOT/hot-osm-population/)
[info] Compiling 11 Scala sources to /home/wille/projetos/HOT/hot-osm-population/target/scala-2.11/classes...
[error] /home/wille/projetos/HOT/hot-osm-population/src/main/scala/FootprintGenerator.scala:168: value getDouble is not a member of geotrellis.raster.Raster[geotrellis.raster.Tile]
[error]       val v = buildings.getDouble(x, y)
[error]                         ^
[warn] /home/wille/projetos/HOT/hot-osm-population/src/main/scala/LabeledPredictApp.scala:68: discarded non-Unit value
[warn]       Output.generateJsonFromTiles(assembled, model, outputUri)
[warn]                                   ^
[warn] /home/wille/projetos/HOT/hot-osm-population/src/main/scala/Predict.scala:74: discarded non-Unit value
[warn]       Output.generateJsonFromTiles(assembled, model, outputUri)
[warn]                                   ^
[error] /home/wille/projetos/HOT/hot-osm-population/src/main/scala/Utils.scala:154: too many arguments for method fromLayerRDD: (rdd: org.apache.spark.rdd.RDD[(K, V)] with geotrellis.spark.Metadata[geotrellis.spark.TileLayerMetadata[K]], baseZoom: Int, minZoom: Option[Int], options: geotrellis.spark.io.cog.COGLayerWriter.Options)(implicit evidence$1: geotrellis.spark.SpatialComponent[K], implicit evidence$2: Ordering[K], implicit evidence$3: spray.json.JsonFormat[K], implicit evidence$4: scala.reflect.ClassTag[K], implicit evidence$5: scala.reflect.ClassTag[V], implicit evidence$6: V => geotrellis.raster.merge.TileMergeMethods[V], implicit evidence$7: V => geotrellis.raster.prototype.TilePrototypeMethods[V], implicit evidence$8: V => geotrellis.raster.crop.TileCropMethods[V], implicit evidence$9: geotrellis.raster.io.geotiff.GeoTiffBuilder[V])geotrellis.spark.io.cog.COGLayer[K,V]
[error]       COGLayer.fromLayerRDD(
[error]                            ^
[error] /home/wille/projetos/HOT/hot-osm-population/src/main/scala/WorldPop.scala:95: overloaded method value readSingleband with alternatives:
[error]   (byteReader: geotrellis.util.ByteReader,streaming: Boolean,withOverviews: Boolean,byteReaderExternal: Option[geotrellis.util.ByteReader])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,e: Option[geotrellis.vector.Extent])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,e: geotrellis.vector.Extent)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (bytes: Array[Byte],streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (bytes: Array[Byte])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,e: Option[geotrellis.vector.Extent])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,e: geotrellis.vector.Extent)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String)geotrellis.raster.io.geotiff.SinglebandGeoTiff
[error]  cannot be applied to (geotrellis.util.RangeReader, decompress: Boolean, streaming: Boolean)
[error]       GeoTiffReader.readSingleband(rr, decompress = false, streaming = true)
[error]                     ^
[error] /home/wille/projetos/HOT/hot-osm-population/src/main/scala/WorldPop.scala:117: overloaded method value readSingleband with alternatives:
[error]   (byteReader: geotrellis.util.ByteReader,streaming: Boolean,withOverviews: Boolean,byteReaderExternal: Option[geotrellis.util.ByteReader])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,e: Option[geotrellis.vector.Extent])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,e: geotrellis.vector.Extent)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (bytes: Array[Byte],streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (bytes: Array[Byte])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,e: Option[geotrellis.vector.Extent])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,e: geotrellis.vector.Extent)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String)geotrellis.raster.io.geotiff.SinglebandGeoTiff
[error]  cannot be applied to (geotrellis.util.RangeReader, decompress: Boolean, streaming: Boolean)
[error] Error occurred in an application involving default arguments.
[error]         GeoTiffReader.readSingleband(rr, decompress = false, streaming = true)
[error]                       ^
[error] /home/wille/projetos/HOT/hot-osm-population/src/main/scala/WorldPop.scala:154: overloaded method value readSingleband with alternatives:
[error]   (byteReader: geotrellis.util.ByteReader,streaming: Boolean,withOverviews: Boolean,byteReaderExternal: Option[geotrellis.util.ByteReader])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,e: Option[geotrellis.vector.Extent])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,e: geotrellis.vector.Extent)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (bytes: Array[Byte],streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (bytes: Array[Byte])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,e: Option[geotrellis.vector.Extent])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,e: geotrellis.vector.Extent)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String)geotrellis.raster.io.geotiff.SinglebandGeoTiff
[error]  cannot be applied to (geotrellis.util.RangeReader, decompress: Boolean, streaming: Boolean)
[error]       GeoTiffReader.readSingleband(rr, decompress = false, streaming = true)
[error]                     ^
[error] /home/wille/projetos/HOT/hot-osm-population/src/main/scala/WorldPop.scala:179: overloaded method value readSingleband with alternatives:
[error]   (byteReader: geotrellis.util.ByteReader,streaming: Boolean,withOverviews: Boolean,byteReaderExternal: Option[geotrellis.util.ByteReader])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,e: Option[geotrellis.vector.Extent])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader,e: geotrellis.vector.Extent)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (byteReader: geotrellis.util.ByteReader)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (bytes: Array[Byte],streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (bytes: Array[Byte])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,streaming: Boolean)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,e: Option[geotrellis.vector.Extent])geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String,e: geotrellis.vector.Extent)geotrellis.raster.io.geotiff.SinglebandGeoTiff <and>
[error]   (path: String)geotrellis.raster.io.geotiff.SinglebandGeoTiff
[error]  cannot be applied to (geotrellis.util.RangeReader, decompress: Boolean, streaming: Boolean)
[error] Error occurred in an application involving default arguments.
[error]           GeoTiffReader.readSingleband(rr, decompress = false, streaming = true)
[error]                         ^
[warn] two warnings found
[error] 6 errors found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 25 s, completed 20/11/2018 10:53:57
make: *** [Makefile:13: target/scala-2.11/hot-osm-population-assembly.jar] Error 1

Add filter for low population areas

There is ambiguity in the index results for areas with low population. Because we can expect that that every cell of WorldPop will contain some population the model will predict population for clearly unpopulated areas. Generally this will be over-estimate and these areas will be marked as poor coverage.

The solution is to add a histogram on population here: https://github.com/azavea/hot-osm-population/blob/master/src/main/scala/Output.scala#L93

.. and manually set the index to null for those areas where population area is below some threshold percentile. 50% should be safe.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.