diff --git a/src/main.cpp b/src/main.cpp index 824e1a0..bf2fc46 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,6 +17,7 @@ CellMap produce_cellmap(HeightMap* heightmap, float z) { int length = (heightmap->width-1)*(heightmap->height-1); uint8_t *cells = (uint8_t *) CPLMalloc(sizeof(uint8_t)*length); + std::vector points; for (int i = 0; iwidth-1); int x = i%(heightmap->width-1); @@ -24,7 +25,10 @@ CellMap produce_cellmap(HeightMap* heightmap, float z) (heightmap->get_pixel(x+1,y)>z)*2 + (heightmap->get_pixel(x+1,y+1)>z)*4 + (heightmap->get_pixel(x,y+1)>z)*8; - *(cells + i) = result; + if (result != 0 and result != 15 ) { + points.push_back(Point(x, y, result)); + + }; } return CellMap(heightmap->width-1, heightmap->height-1, cells, heightmap->reference_system, heightmap->geotransform); @@ -180,5 +184,5 @@ int main(int argc, const char* argv[]) auto cellmap = produce_cellmap(&map, 40); auto cellmaps = vector_cellmap(&map, 5); - write_output_file(cellmaps, "out.geojson"); + //write_output_file(cellmaps, "out.geojson"); } \ No newline at end of file