GithubHelp home page GithubHelp logo

karimnaaji / vectiler Goto Github PK

View Code? Open in Web Editor NEW
474.0 27.0 70.0 23.52 MB

A vector tile, terrain and city 3d model builder and CLI exporter. Consider using its fully integrated user interface at https://halfmaps.io

Home Page: https://karim.naaji.fr/projects/vectiler

License: MIT License

CMake 0.38% C++ 50.66% C 48.96%
models computer-graphics vector-tiles osm cpp openstreetmap terrain srtm city-builder

vectiler's People

Contributors

96fps avatar karimnaaji avatar

Stargazers

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

Watchers

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

vectiler's Issues

Formula pass is old

$ cp 3rdparty/aobaker/embree.rb /usr/local/Library/Formula

Homerew Formula path was changed in 1.0.0.
Now Homebrew Formula path is
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/

"Assertion `IsArray()' failed"

I've just built Vectiler and tried the example command line from the README. It fails with this error message:

$ build/vectiler.out --tilex 5242/5260 --tiley 12642/12666 --tilez 15 --terrain 1 --buildings 1 --terrainExtrusionScale 1.5 --buildingsExtrusionScale 1.9
Using API key xwlF66_oRKWWb058St_Q9Q
---- Downloading tile data ----
URL request: https://tile.nextzen.org/tilezen/terrain/v1/260/terrarium/15/5242/12642.png?api_key=xwlF66_oRKWWb058St_Q9Q -- OK
URL request: https://tile.nextzen.org/tilezen/vector/v1/256/all/15/5242/12642.json?api_key=xwlF66_oRKWWb058St_Q9Q -- OK     
vectiler.out: /home/darabos/anaconda3/envs/dr/include/rapidjson/document.h:1505: rapidjson::GenericValue<Encoding, Allocator>* rapidjson::GenericValue<Encoding, Allocator>::Begin() [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::GenericValue<Encoding, Allocator>::ValueIterator = rapidjson::GenericValue<rapidjson::UTF8<> >*]:
Assertion `IsArray()' failed.
Aborted

When I check the JSON returned by https://tile.nextzen.org/tilezen/vector/v1/256/all/15/5242/12642.json?api_key=xwlF66_oRKWWb058St_Q9Q it looks fine to me. Any tips for what I may be doing wrong? Thanks!

Assertion failed error with aobaker

I'm able to get non-AO objs to export but whenever I try and do an AO export I get the following crash:

$ ./objexport --tilex 19294 --tiley 24642 --tilez 16 --sizehint 512 --nsamples 128 --bakeAO 1
Fetching URL with curl: http://vector.mapzen.com/osm/all/16/19294/24642.json?api_key=vector-tiles-qVaBcRA
Fetched tile: http://vector.mapzen.com/osm/all/16/19294/24642.json?api_key=vector-tiles-qVaBcRA
Save 19294.24642.16.obj
Assertion failed: (in_positions.size() > (unsigned int)(3 * i.v_idx + 2)), function updateVertex, file /Users/Robin/Downloads/vectiler/3rdparty/aobaker/vendor/tinyobj/tiny_obj_loader.h, line 426.
[1]    24818 abort      ./objexport --tilex 19294 --tiley 24642 --tilez 16 --sizehint 512 --nsamples

Any idea what's going on? I'd love to get AO baking to work so I can try this out in ViziCities.

normal generator created lines with nan on them

I ran with this command:
./build/vectiler.out --tilex 4353/4353 --tiley 6557/6557 --tilez 14 --terrain 1 --buildings 1 --terrainExtrusionScale 1 --buildingsExtrusionScale 1 --roads 1 --normals 1

Somewhere down inside it created two lines with nan on them:

vn nan nan nan
vn nan nan nan

Project usage at present

Hello! Right off the bat, I'd like to say this is a really cool project. I have a few concerns and doubts regarding it's usage at present.

Poking around and running the demo CLI example, the output is as expected. I'm not however, able to get any other model of choice. For example, running
./vectiler.out --tilex 16811/16821 --tiley 24364/24374 --tilez 15 --terrain 1 --buildings 1 --terrainExtrusionScale 1.5 --buildingsExtrusionScale 1.9
gives just a flat pane, with no 3d information at all.

I'm wondering if this is because of my lack of understanding of vector tile coordinates, (I've tried my best to understand it) Or because MapZen, which this project queries, has recently shut down.

Any help/updates regarding the above would be great, as I'm interested in using and adding onto this project. Thanks!!

Issues building with earcut.hpp

Hi Karim! Are you still maintaining this awesome tool? If so, just wanted to point out I'm having issues building the repo on a Mac OSX V10.12.3. I downloaded all the 3rd party resources (the right commit version) and was able to set up my build/ folder. But when i execute cmake --build build I'm getting:

/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:349:13: error: no template named 'Earcut' in namespace 'mapbox'; did you mean 'earcut'?
    mapbox::Earcut<float, unsigned int> earcut;
    ~~~~~~~~^~~~~~
            earcut
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:768:16: note: 'earcut' declared here
std::vector<N> earcut(const Polygon& poly) {
               ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:349:19: error: expected ';' after expression
    mapbox::Earcut<float, unsigned int> earcut;
                  ^
                  ;
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:349:41: error: use of undeclared identifier 'earcut'; did you mean 'mapbox::earcut'?
    mapbox::Earcut<float, unsigned int> earcut;
                                        ^~~~~~
                                        mapbox::earcut
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:768:16: note: 'mapbox::earcut' declared here
std::vector<N> earcut(const Polygon& poly) {
               ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:349:41: error: reference to overloaded function could not be resolved; did you mean to call it?
    mapbox::Earcut<float, unsigned int> earcut;
                                        ^~~~~~
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:768:16: note: possible target for call
std::vector<N> earcut(const Polygon& poly) {
               ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:351:5: error: use of undeclared identifier 'earcut'; did you mean 'mapbox::earcut'?
    earcut(polygon);
    ^~~~~~
    mapbox::earcut
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:768:16: note: 'mapbox::earcut' declared here
std::vector<N> earcut(const Polygon& poly) {
               ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:355:9: error: use of undeclared identifier 'earcut'; did you mean 'mapbox::earcut'?
    if (earcut.indices.size() == 0) {
        ^~~~~~
        mapbox::earcut
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:768:16: note: 'mapbox::earcut' declared here
std::vector<N> earcut(const Polygon& poly) {
               ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:355:9: error: reference to overloaded function could not be resolved; did you mean to call it?
    if (earcut.indices.size() == 0) {
        ^~~~~~
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:768:16: note: possible target for call
std::vector<N> earcut(const Polygon& poly) {
               ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:360:32: error: use of undeclared identifier 'earcut'
        outIndices = std::move(earcut.indices);
                               ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:362:48: error: use of undeclared identifier 'earcut'
        outIndices.reserve(outIndices.size() + earcut.indices.size());
                                               ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:364:23: error: use of undeclared identifier 'earcut'
        for (auto i : earcut.indices) {
                      ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:371:46: error: use of undeclared identifier 'earcut'
    outVertices.reserve(outVertices.size() + earcut.vertices.size());
                                             ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:375:20: error: use of undeclared identifier 'earcut'
    for (auto& p : earcut.vertices) {
                   ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:349:5: warning: expression result unused [-Wunused-value]
    mapbox::Earcut<float, unsigned int> earcut;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/ire/Downloads/vectiler-master/src/vectiler.cpp:13:
In file included from /Users/ire/Downloads/vectiler-master/src/earcut.h:3:
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:134:15: error: member reference base type 'const unsigned int' is not a structure or union
    if (points.empty()) return;
        ~~~~~~^~~~~~
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:770:5: note: in instantiation of function template specialization
      'mapbox::detail::Earcut<float>::operator()<unsigned int>' requested here
    earcut(poly);
    ^
/Users/ire/Downloads/vectiler-master/src/vectiler.cpp:349:13: note: in instantiation of function template specialization 'mapbox::earcut<float, unsigned int>'
      requested here
    mapbox::Earcut<float, unsigned int> earcut;
            ^
In file included from /Users/ire/Downloads/vectiler-master/src/vectiler.cpp:13:
In file included from /Users/ire/Downloads/vectiler-master/src/earcut.h:3:
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:142:52: error: member reference base type 'const unsigned int' is not a structure or union
    for (size_t i = 0; threshold >= 0 && i < points.size(); i++) {
                                             ~~~~~~^~~~~
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:149:27: error: subscripted value is not an array, pointer, or vector
    indices.reserve(len + points[0].size());
                          ^~~~~~ ~
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:151:34: error: subscripted value is not an array, pointer, or vector
    Node* outerNode = linkedList(points[0], true);
                                 ^~~~~~ ~
/Users/ire/Downloads/vectiler-master/src/earcut.hpp:154:15: error: member reference base type 'const unsigned int' is not a structure or union
    if (points.size() > 1) outerNode = eliminateHoles(points, outerNode);
        ~~~~~~^~~~~
1 warning and 17 errors generated.
make[2]: *** [CMakeFiles/vectiler_core.dir/src/vectiler.cpp.o] Error 1
make[1]: *** [CMakeFiles/vectiler_core.dir/all] Error 2
make: *** [all] Error 2

What am I doing wrong? Cheers from Pittsburgh!

I don't get it oO

Well, hi there!

Very interesting project but I didn't get anything. I tried on MAC Sierra, tried on Windows. But no success.

Well, on Mac. I have to Clone the repo? couse the "vectiler-osx-x86_64.out" doesn't do nothing. Just open the App Store and nothing, just a bunch of others apps nothing to do with.

So I gonna do my tries here. Can anyone clarify my path?

Best Regards.

Installation issue

After running "cmake -- build ." I get the following:

$ cmake --build .
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 6-10-2017 10:36:25.
Project "C:\Users\kenny\Desktop\map\build\ALL_BUILD.vcxproj" on node 1 (default                                                                                                                                                                                                                                                                           targets).
Project "C:\Users\kenny\Desktop\map\build\ALL_BUILD.vcxproj" (1) is building "C:                                                                                                                                                                                                                                                                          \Users\kenny\Desktop\map\build\ZERO_CHECK.vcxproj" (2) on node 1 (default target                                                                                                                                                                                                                                                                          s).
PrepareForBuild:
  Creating directory "x64\Debug\ZERO_CHECK\".
  Creating directory "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\".
InitializeBuildStatus:
  Creating "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "Alw                                                                                                                                                                                                                                                                          aysCreate" was specified.
CustomBuild:
  Checking Build System
  CMake does not need to re-run because C:/Users/kenny/Desktop/map/build/CMakeFi                                                                                                                                                                                                                                                                          les/generate.stamp is up-to-date.
FinalizeBuildStatus:
  Deleting file "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
  Touching "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\Users\kenny\Desktop\map\build\ZERO_CHECK.vcxproj" (def                                                                                                                                                                                                                                                                          ault targets).
Project "C:\Users\kenny\Desktop\map\build\ALL_BUILD.vcxproj" (1) is building "C:                                                                                                                                                                                                                                                                          \Users\kenny\Desktop\map\build\vectiler.vcxproj" (3) on node 1 (default targets)                                                                                                                                                                                                                                                                          .
Project "C:\Users\kenny\Desktop\map\build\vectiler.vcxproj" (3) is building "C:\                                                                                                                                                                                                                                                                          Users\kenny\Desktop\map\build\vectiler_core.vcxproj" (4) on node 1 (default targ                                                                                                                                                                                                                                                                          ets).
PrepareForBuild:
  Creating directory "vectiler_core.dir\Debug\".
  Creating directory "C:\Users\kenny\Desktop\map\build\Debug\".
  Creating directory "vectiler_core.dir\Debug\vectiler_core.tlog\".
InitializeBuildStatus:
  Creating "vectiler_core.dir\Debug\vectiler_core.tlog\unsuccessfulbuild" becaus                                                                                                                                                                                                                                                                          e "AlwaysCreate" was specified.
CustomBuild:
  Building Custom Rule C:/Users/kenny/Desktop/map/CMakeLists.txt
  CMake does not need to re-run because C:/Users/kenny/Desktop/map/build/CMakeFi                                                                                                                                                                                                                                                                          les/generate.stamp is up-to-date.
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c                                                                                                                                                                                                                                                                           /IC:\Users\kenny\Desktop\map\src /IC:\Users\kenny\Desktop\map\platform /IC:\Use                                                                                                                                                                                                                                                                          rs\kenny\Desktop\map\3rdparty\glm /IC:\Users\kenny\Desktop\map\3rdparty\rapidjso                                                                                                                                                                                                                                                                          n\include /IC:\Users\kenny\Desktop\map\3rdparty\earcut.hpp\include /IC:\Users\ke                                                                                                                                                                                                                                                                          nny\Desktop\map\3rdparty\flag /Zi /nologo /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS                                                                                                                                                                                                                                                                           /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:                                                                                                                                                                                                                                                                          wchar_t /Zc:forScope /Zc:inline /GR /Fo"vectiler_core.dir\Debug\\" /Fd"vectiler_                                                                                                                                                                                                                                                                          core.dir\Debug\vectiler_core.pdb" /Gd /TP /errorReport:queue C:\Users\kenny\Desk                                                                                                                                                                                                                                                                          top\map\src\geojson.cpp C:\Users\kenny\Desktop\map\src\projection.cpp C:\Users\k                                                                                                                                                                                                                                                                          enny\Desktop\map\src\vectiler.cpp C:\Users\kenny\Desktop\map\platform\windows_ht                                                                                                                                                                                                                                                                          tpget.cpp
  geojson.cpp
c:\users\kenny\desktop\map\src\geojson.h(7): fatal error C1083: Cannot open incl                                                                                                                                                                                                                                                                          ude file: 'rapidjson/document.h': No such file or directory [C:\Users\kenny\Desk                                                                                                                                                                                                                                                                          top\map\build\vectiler_core.vcxproj]
  projection.cpp
c:\users\kenny\desktop\map\src\projection.h(3): fatal error C1083: Cannot open i                                                                                                                                                                                                                                                                          nclude file: 'glm/glm.hpp': No such file or directory [C:\Users\kenny\Desktop\ma                                                                                                                                                                                                                                                                          p\build\vectiler_core.vcxproj]
  vectiler.cpp
C:\Users\kenny\Desktop\map\src\vectiler.cpp(9): fatal error C1083: Cannot open i                                                                                                                                                                                                                                                                          nclude file: 'rapidjson/document.h': No such file or directory [C:\Users\kenny\D                                                                                                                                                                                                                                                                          esktop\map\build\vectiler_core.vcxproj]
  windows_httpget.cpp
c:\users\kenny\desktop\map\platform\windows/miniz.c(1107): warning C4334: '<<':                                                                                                                                                                                                                                                                           result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intende                                                                                                                                                                                                                                                                          d?) [C:\Users\kenny\Desktop\map\build\vectiler_core.vcxproj]
c:\users\kenny\desktop\map\platform\windows/miniz.c(2478): warning C4838: conver                                                                                                                                                                                                                                                                          sion from 'const char' to 'mz_uint8' requires a narrowing conversion [C:\Users\k                                                                                                                                                                                                                                                                          enny\Desktop\map\build\vectiler_core.vcxproj]
c:\users\kenny\desktop\map\platform\windows/mini_gzip.c(118): warning C4267: '+=                                                                                                                                                                                                                                                                          ': conversion from 'size_t' to 'unsigned int', possible loss of data [C:\Users\k                                                                                                                                                                                                                                                                          enny\Desktop\map\build\vectiler_core.vcxproj]
  Generating Code...
Done Building Project "C:\Users\kenny\Desktop\map\build\vectiler_core.vcxproj" (                                                                                                                                                                                                                                                                          default targets) -- FAILED.
Done Building Project "C:\Users\kenny\Desktop\map\build\vectiler.vcxproj" (defau                                                                                                                                                                                                                                                                          lt targets) -- FAILED.
Done Building Project "C:\Users\kenny\Desktop\map\build\ALL_BUILD.vcxproj" (defa                                                                                                                                                                                                                                                                          ult targets) -- FAILED.

Build FAILED.

"C:\Users\kenny\Desktop\map\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\kenny\Desktop\map\build\vectiler.vcxproj" (default target) (3) ->
"C:\Users\kenny\Desktop\map\build\vectiler_core.vcxproj" (default target) (4) ->
(ClCompile target) ->
  c:\users\kenny\desktop\map\platform\windows/miniz.c(1107): warning C4334: '<<'                                                                                                                                                                                                                                                                          : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift inten                                                                                                                                                                                                                                                                          ded?) [C:\Users\kenny\Desktop\map\build\vectiler_core.vcxproj]
  c:\users\kenny\desktop\map\platform\windows/miniz.c(2478): warning C4838: conv                                                                                                                                                                                                                                                                          ersion from 'const char' to 'mz_uint8' requires a narrowing conversion [C:\Users                                                                                                                                                                                                                                                                          \kenny\Desktop\map\build\vectiler_core.vcxproj]
  c:\users\kenny\desktop\map\platform\windows/mini_gzip.c(118): warning C4267: '                                                                                                                                                                                                                                                                          +=': conversion from 'size_t' to 'unsigned int', possible loss of data [C:\Users                                                                                                                                                                                                                                                                          \kenny\Desktop\map\build\vectiler_core.vcxproj]


"C:\Users\kenny\Desktop\map\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\kenny\Desktop\map\build\vectiler.vcxproj" (default target) (3) ->
"C:\Users\kenny\Desktop\map\build\vectiler_core.vcxproj" (default target) (4) ->
(ClCompile target) ->
  c:\users\kenny\desktop\map\src\geojson.h(7): fatal error C1083: Cannot open in                                                                                                                                                                                                                                                                          clude file: 'rapidjson/document.h': No such file or directory [C:\Users\kenny\De                                                                                                                                                                                                                                                                          sktop\map\build\vectiler_core.vcxproj]
  c:\users\kenny\desktop\map\src\projection.h(3): fatal error C1083: Cannot open                                                                                                                                                                                                                                                                           include file: 'glm/glm.hpp': No such file or directory [C:\Users\kenny\Desktop\                                                                                                                                                                                                                                                                          map\build\vectiler_core.vcxproj]
  C:\Users\kenny\Desktop\map\src\vectiler.cpp(9): fatal error C1083: Cannot open                                                                                                                                                                                                                                                                           include file: 'rapidjson/document.h': No such file or directory [C:\Users\kenny                                                                                                                                                                                                                                                                          \Desktop\map\build\vectiler_core.vcxproj]

    3 Warning(s)
    3 Error(s)

Time Elapsed 00:00:01.79

Windows?

Hi!
I'd be interested to use you're program to get some 3D Data .
Can I use it with Windows somehow?

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.