├── .clang-format ├── .clang-tidy ├── .gitattributes ├── .gitignore ├── .gitmodules ├── .npmignore ├── .npmrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── bench ├── boundary.pbf └── error │ ├── test_vt_abort.js │ └── test_vt_abort2.js ├── bin ├── mapnik-index.js ├── mapnik-inspect.js ├── mapnik-render.js └── mapnik-shapeindex.js ├── binding.gyp ├── common.gypi ├── docs └── Using-Fonts.md ├── index.js ├── package.json ├── scripts ├── postinstall.sh └── preinstall.sh ├── src ├── blend.cpp ├── blend.hpp ├── ds_emitter.hpp ├── js_grid_utils.hpp ├── mapnik_cairo_surface.cpp ├── mapnik_cairo_surface.hpp ├── mapnik_color.cpp ├── mapnik_color.hpp ├── mapnik_datasource.cpp ├── mapnik_datasource.hpp ├── mapnik_expression.cpp ├── mapnik_expression.hpp ├── mapnik_feature.cpp ├── mapnik_feature.hpp ├── mapnik_featureset.cpp ├── mapnik_featureset.hpp ├── mapnik_fonts.hpp ├── mapnik_geometry.cpp ├── mapnik_geometry.hpp ├── mapnik_grid.cpp ├── mapnik_grid.hpp ├── mapnik_grid_view.cpp ├── mapnik_grid_view.hpp ├── mapnik_image.cpp ├── mapnik_image.hpp ├── mapnik_image_clear.cpp ├── mapnik_image_compositing.cpp ├── mapnik_image_copy.cpp ├── mapnik_image_encode.cpp ├── mapnik_image_fill.cpp ├── mapnik_image_filter.cpp ├── mapnik_image_from_bytes.cpp ├── mapnik_image_from_svg.cpp ├── mapnik_image_multiply.cpp ├── mapnik_image_open.cpp ├── mapnik_image_resize.cpp ├── mapnik_image_save.cpp ├── mapnik_image_solid.cpp ├── mapnik_image_view.cpp ├── mapnik_image_view.hpp ├── mapnik_layer.cpp ├── mapnik_layer.hpp ├── mapnik_logger.cpp ├── mapnik_logger.hpp ├── mapnik_map.cpp ├── mapnik_map.hpp ├── mapnik_map_from_string.cpp ├── mapnik_map_load.cpp ├── mapnik_map_query_point.cpp ├── mapnik_map_render.cpp ├── mapnik_palette.cpp ├── mapnik_palette.hpp ├── mapnik_plugins.hpp ├── mapnik_projection.cpp ├── mapnik_projection.hpp ├── mapnik_vector_tile.cpp ├── mapnik_vector_tile.hpp ├── mapnik_vector_tile_clear.cpp ├── mapnik_vector_tile_composite.cpp ├── mapnik_vector_tile_data.cpp ├── mapnik_vector_tile_image.cpp ├── mapnik_vector_tile_info.cpp ├── mapnik_vector_tile_json.cpp ├── mapnik_vector_tile_query.cpp ├── mapnik_vector_tile_render.cpp ├── mapnik_vector_tile_simple_valid.cpp ├── node_mapnik.cpp ├── object_to_container.hpp ├── pixel_utils.hpp ├── tint.hpp ├── utf8.hpp └── utils.hpp ├── test ├── blend-fixtures │ ├── 1.png │ ├── 1a.png │ ├── 1x1.png │ ├── 2.png │ ├── 2a.png │ ├── 3.png │ ├── corrupt-1.png │ ├── expected-compression-5.webp │ ├── expected-hex-palette-256-tiny.png │ ├── expected-hex-palette-256.png │ ├── expected-matte-6.png │ ├── expected-matte-8.png │ ├── expected-object-tint.png │ ├── expected-object-x-y.png │ ├── expected-oct-palette-256.png │ ├── expected-palette-256.png │ ├── expected-reverse.png │ ├── expected.jpg │ ├── expected.png │ ├── expected.webp │ └── not_a_real_image.txt ├── blend.test.js ├── cairo_surface.test.js ├── color.test.js ├── compositing.test.js ├── constants.test.js ├── data │ ├── NZ_Coastline_NZMG.dbf │ ├── NZ_Coastline_NZMG.prj │ ├── NZ_Coastline_NZMG.qpj │ ├── NZ_Coastline_NZMG.shp │ ├── NZ_Coastline_NZMG.shx │ ├── avlee-区县级行政区划.csv │ ├── dir-区县级行政区划 │ │ ├── points.csv │ │ ├── 你好-ellipses.svg │ │ └── 你好_DejaVuSansMono-BoldOblique.ttf │ ├── images │ │ ├── 10x10.jpeg │ │ ├── 10x10.png │ │ ├── 10x10.tiff │ │ ├── 10x10.webp │ │ ├── 14_2788_6533.webp │ │ ├── corrupt-10x10.png │ │ ├── large_overzoom.expected.png │ │ ├── san-marino.svg │ │ ├── sat_image-expected-100x100-bessel.png │ │ ├── sat_image-expected-100x100-bicubic.png │ │ ├── sat_image-expected-100x100-bilinear.png │ │ ├── sat_image-expected-100x100-blackman.png │ │ ├── sat_image-expected-100x100-catrom.png │ │ ├── sat_image-expected-100x100-gaussian.png │ │ ├── sat_image-expected-100x100-hamming.png │ │ ├── sat_image-expected-100x100-hanning.png │ │ ├── sat_image-expected-100x100-hermite.png │ │ ├── sat_image-expected-100x100-kaiser.png │ │ ├── sat_image-expected-100x100-lanczos.png │ │ ├── sat_image-expected-100x100-mitchell.png │ │ ├── sat_image-expected-100x100-near.png │ │ ├── sat_image-expected-100x100-near.tif │ │ ├── sat_image-expected-100x100-offset.tif │ │ ├── sat_image-expected-100x100-quadric.png │ │ ├── sat_image-expected-100x100-sinc.png │ │ ├── sat_image-expected-100x100-spline16.png │ │ ├── sat_image-expected-100x100-spline36.png │ │ ├── sat_image-expected-50x50-bessel.png │ │ ├── sat_image-expected-50x50-bicubic.png │ │ ├── sat_image-expected-50x50-bilinear.png │ │ ├── sat_image-expected-50x50-blackman.png │ │ ├── sat_image-expected-50x50-catrom.png │ │ ├── sat_image-expected-50x50-gaussian.png │ │ ├── sat_image-expected-50x50-hamming.png │ │ ├── sat_image-expected-50x50-hanning.png │ │ ├── sat_image-expected-50x50-hermite.png │ │ ├── sat_image-expected-50x50-kaiser.png │ │ ├── sat_image-expected-50x50-lanczos.png │ │ ├── sat_image-expected-50x50-mitchell.png │ │ ├── sat_image-expected-50x50-multiple_offset.tif │ │ ├── sat_image-expected-50x50-near.png │ │ ├── sat_image-expected-50x50-near.tif │ │ ├── sat_image-expected-50x50-offset.tif │ │ ├── sat_image-expected-50x50-offset_wh.tif │ │ ├── sat_image-expected-50x50-quadric.png │ │ ├── sat_image-expected-50x50-sinc.png │ │ ├── sat_image-expected-50x50-spline16.png │ │ ├── sat_image-expected-50x50-spline36.png │ │ ├── sat_image.png │ │ ├── sat_image.tif │ │ ├── sat_image2-expected-offset.png │ │ └── sat_image2.jpg │ ├── large_overzoom.xml │ ├── map-a │ │ └── DejaVuSerifCondensed-BoldItalic.ttf │ ├── map-b │ │ └── DejaVuSerifCondensed-Bold.ttf │ ├── map.xml │ ├── markers.xml │ ├── parse.error.json │ ├── postgis-create-db-and-tables.sql │ ├── postgis_datasource_tokens_query.xml │ ├── roads.csv │ ├── roads.xml │ ├── sat_map.xml │ ├── ünicode_symbols.xml │ ├── v4-10_131_242.mvt │ ├── v6-0_0_0.mvt │ ├── vector_tile │ │ ├── 10.196.370.vector.pbf │ │ ├── 12.771.1608.vector.pbf │ │ ├── 13-2411-3080.png │ │ ├── 13.1337.2825.vector.pbf │ │ ├── 3.2.3.mbs4.mvt │ │ ├── 6.20.34.pbf │ │ ├── cloudless_1_0_0.jpg │ │ ├── compositing │ │ │ ├── 25084.vector.pbf │ │ │ ├── 25084_2.vector.pbf │ │ │ ├── badtile.mvt │ │ │ ├── badtile.xml │ │ │ ├── expected │ │ │ │ ├── 0-0-0-mosaic.png │ │ │ │ ├── 2-1-1-empty.png │ │ │ │ ├── 2-1-1-no-point.png │ │ │ │ ├── 2-1-1.png │ │ │ │ ├── 2-1-1b.png │ │ │ │ ├── concat.png │ │ │ │ ├── image_concat.png │ │ │ │ ├── world-reencode-max-extent.png │ │ │ │ └── world-reencode.png │ │ │ ├── layers │ │ │ │ ├── lines.xml │ │ │ │ └── points.xml │ │ │ ├── styles │ │ │ │ └── all.xml │ │ │ └── tiles │ │ │ │ ├── lines-0-0-0.mvt │ │ │ │ ├── lines-1-0-0.mvt │ │ │ │ ├── lines-1-0-1.mvt │ │ │ │ ├── lines-1-1-0.mvt │ │ │ │ ├── lines-1-1-1.mvt │ │ │ │ ├── lines-2-0-0.mvt │ │ │ │ ├── lines-2-0-1.mvt │ │ │ │ ├── lines-2-1-1.mvt │ │ │ │ ├── points-0-0-0.mvt │ │ │ │ ├── points-1-0-0.mvt │ │ │ │ ├── points-1-0-1.mvt │ │ │ │ ├── points-1-1-0.mvt │ │ │ │ ├── points-1-1-1.mvt │ │ │ │ ├── points-2-0-0.mvt │ │ │ │ ├── points-2-0-1.mvt │ │ │ │ └── points-2-1-1.mvt │ │ ├── errors.svg │ │ ├── generic_map.xml │ │ ├── invalid_v2_tile.mvt │ │ ├── invalid_v2_tile_bad_geom.mvt │ │ ├── layers.xml │ │ ├── natural_earth.tif │ │ ├── nz-1.png │ │ ├── nz-1b.png │ │ ├── pasted │ │ │ ├── pasted1.dbf │ │ │ ├── pasted1.mvt │ │ │ ├── pasted1.prj │ │ │ ├── pasted1.shp │ │ │ ├── pasted1.shx │ │ │ ├── pasted1.xml │ │ │ ├── pasted10.dbf │ │ │ ├── pasted10.mvt │ │ │ ├── pasted10.prj │ │ │ ├── pasted10.shp │ │ │ ├── pasted10.shx │ │ │ ├── pasted10.xml │ │ │ ├── pasted11.dbf │ │ │ ├── pasted11.mvt │ │ │ ├── pasted11.prj │ │ │ ├── pasted11.shp │ │ │ ├── pasted11.shx │ │ │ ├── pasted11.xml │ │ │ ├── pasted12.geojson │ │ │ ├── pasted12.mvt │ │ │ ├── pasted12.xml │ │ │ ├── pasted13.geojson │ │ │ ├── pasted13.mvt │ │ │ ├── pasted13.xml │ │ │ ├── pasted14.geojson │ │ │ ├── pasted14.mvt │ │ │ ├── pasted14.xml │ │ │ ├── pasted15.dbf │ │ │ ├── pasted15.mvt │ │ │ ├── pasted15.prj │ │ │ ├── pasted15.shp │ │ │ ├── pasted15.shx │ │ │ ├── pasted15.xml │ │ │ ├── pasted16.dbf │ │ │ ├── pasted16.mvt │ │ │ ├── pasted16.prj │ │ │ ├── pasted16.shp │ │ │ ├── pasted16.shx │ │ │ ├── pasted16.xml │ │ │ ├── pasted17.geojson │ │ │ ├── pasted17.mvt │ │ │ ├── pasted17.xml │ │ │ ├── pasted18.dbf │ │ │ ├── pasted18.mvt │ │ │ ├── pasted18.prj │ │ │ ├── pasted18.shp │ │ │ ├── pasted18.shx │ │ │ ├── pasted18.xml │ │ │ ├── pasted19.dbf │ │ │ ├── pasted19.mvt │ │ │ ├── pasted19.prj │ │ │ ├── pasted19.shp │ │ │ ├── pasted19.shx │ │ │ ├── pasted19.xml │ │ │ ├── pasted2.dbf │ │ │ ├── pasted2.mvt │ │ │ ├── pasted2.prj │ │ │ ├── pasted2.shp │ │ │ ├── pasted2.shx │ │ │ ├── pasted2.xml │ │ │ ├── pasted20.dbf │ │ │ ├── pasted20.mvt │ │ │ ├── pasted20.prj │ │ │ ├── pasted20.shp │ │ │ ├── pasted20.shx │ │ │ ├── pasted20.xml │ │ │ ├── pasted21.dbf │ │ │ ├── pasted21.mvt │ │ │ ├── pasted21.prj │ │ │ ├── pasted21.shp │ │ │ ├── pasted21.shx │ │ │ ├── pasted21.xml │ │ │ ├── pasted22.dbf │ │ │ ├── pasted22.mvt │ │ │ ├── pasted22.prj │ │ │ ├── pasted22.shp │ │ │ ├── pasted22.shx │ │ │ ├── pasted22.xml │ │ │ ├── pasted23.dbf │ │ │ ├── pasted23.mvt │ │ │ ├── pasted23.prj │ │ │ ├── pasted23.shp │ │ │ ├── pasted23.shx │ │ │ ├── pasted23.xml │ │ │ ├── pasted3.dbf │ │ │ ├── pasted3.mvt │ │ │ ├── pasted3.prj │ │ │ ├── pasted3.shp │ │ │ ├── pasted3.shx │ │ │ ├── pasted3.xml │ │ │ ├── pasted4.dbf │ │ │ ├── pasted4.mvt │ │ │ ├── pasted4.prj │ │ │ ├── pasted4.shp │ │ │ ├── pasted4.shx │ │ │ ├── pasted4.xml │ │ │ ├── pasted5.dbf │ │ │ ├── pasted5.mvt │ │ │ ├── pasted5.prj │ │ │ ├── pasted5.shp │ │ │ ├── pasted5.shx │ │ │ ├── pasted5.xml │ │ │ ├── pasted6.dbf │ │ │ ├── pasted6.mvt │ │ │ ├── pasted6.prj │ │ │ ├── pasted6.shp │ │ │ ├── pasted6.shx │ │ │ ├── pasted6.xml │ │ │ ├── pasted7.dbf │ │ │ ├── pasted7.mvt │ │ │ ├── pasted7.prj │ │ │ ├── pasted7.shp │ │ │ ├── pasted7.shx │ │ │ ├── pasted7.xml │ │ │ ├── pasted8.dbf │ │ │ ├── pasted8.mvt │ │ │ ├── pasted8.prj │ │ │ ├── pasted8.shp │ │ │ ├── pasted8.shx │ │ │ ├── pasted8.xml │ │ │ ├── pasted9_tile0_0_0_0.mvt.mvt │ │ │ └── pasted9_tile1_0_0_0.mvt.mvt │ │ ├── raster_layer.xml │ │ ├── raster_style.xml │ │ ├── tile-raster.expected.png │ │ ├── tile-raster2.expected.png │ │ ├── tile-raster3.expected.png │ │ ├── tile-raster4.expected.png │ │ ├── tile-raster5.expected.png │ │ ├── tile0-area_threshold.mvt │ │ ├── tile0-b.expected.png │ │ ├── tile0-c.expected.png │ │ ├── tile0-evenOdd.mvt │ │ ├── tile0-fields.expected.grid.json │ │ ├── tile0-mpu-false.mvt │ │ ├── tile0-mpu-true.mvt │ │ ├── tile0-nonZero.mvt │ │ ├── tile0-process-all-mp-rings.mvt │ │ ├── tile0-simple_and_distance.mvt │ │ ├── tile0-simple_and_distance.nosse.mvt │ │ ├── tile0-simplify_distance.mvt │ │ ├── tile0-simplify_distance.nosse.mvt │ │ ├── tile0-strictly_simple.mvt │ │ ├── tile0-strictly_simple_false.mvt │ │ ├── tile0.corrupt-svg.svg │ │ ├── tile0.expected-cairo.svg │ │ ├── tile0.expected-svg.svg │ │ ├── tile0.expected.grid.json │ │ ├── tile0.expected.png │ │ ├── tile0.mvt │ │ ├── tile1.vector.pbf │ │ ├── tile1.vector.pbf.gz │ │ ├── tile2.mvt │ │ ├── tile3.expected.png │ │ ├── tile3.mvt │ │ ├── tile_threading_async.mvt │ │ └── tile_threading_auto.mvt │ ├── world_merc.converted.geojson │ ├── world_merc.dbf │ ├── world_merc.json │ ├── world_merc.prj │ ├── world_merc.shp │ ├── world_merc.shx │ ├── world_merc_license.txt │ ├── ünicode_symbols.xml │ ├── 你好_points.csv │ ├── 你好_points.dbf │ ├── 你好_points.geojson │ ├── 你好_points.prj │ ├── 你好_points.shp │ ├── 你好_points.shx │ └── 你好_points.sqlite ├── datasource.test.js ├── expression.test.js ├── feature.test.js ├── font_path.test.js ├── fonts.test.js ├── geometry.test.js ├── geotiff-load.test.js ├── grid.test.js ├── grid_view.test.js ├── image.filter.test.js ├── image.svg.test.js ├── image.test.js ├── image_view.test.js ├── layers.test.js ├── logger.test.js ├── map.test.js ├── map_generation.test.js ├── mapnik-index.test.js ├── mapnik-shapeindex.test.js ├── palette.test.js ├── parameters.test.js ├── plugin.test.js ├── proj_transform.test.js ├── projection.test.js ├── query-map.test.js ├── raster.xml ├── render-async.test.js ├── render-sync.test.js ├── render_grid.test.js ├── shp2geojson.test.js ├── stylesheet.xml ├── support │ ├── a.png │ ├── b.png │ ├── composites.xml │ ├── extra_arbitary_map_parameters.xml │ ├── grid2.json │ ├── grid__id__.json │ ├── grid__id__2.json │ ├── grid__id__3.json │ ├── grid_view.json │ ├── helper.js │ ├── palettes │ │ ├── palette256.act │ │ └── palette64.act │ └── simple_grid.json ├── tmp │ └── placeholder.txt ├── unicode-loading.test.js ├── vector-tile.composite.test.js ├── vector-tile.postgis.test.js ├── vector-tile.query.test.js ├── vector-tile.queryMany.test.js └── vector-tile.test.js └── tools ├── cpp.el └── fix_cpp_style.sh /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | # Mapbox.Variant C/C+ style 3 | Language: Cpp 4 | AccessModifierOffset: -2 5 | AlignAfterOpenBracket: Align 6 | AlignConsecutiveAssignments: false 7 | AlignConsecutiveDeclarations: false 8 | AlignEscapedNewlinesLeft: false 9 | AlignOperands: true 10 | AlignTrailingComments: true 11 | AllowAllParametersOfDeclarationOnNextLine: true 12 | AllowShortBlocksOnASingleLine: false 13 | AllowShortCaseLabelsOnASingleLine: false 14 | AllowShortFunctionsOnASingleLine: All 15 | AllowShortIfStatementsOnASingleLine: true 16 | AllowShortLoopsOnASingleLine: true 17 | AlwaysBreakAfterDefinitionReturnType: None 18 | AlwaysBreakAfterReturnType: None 19 | AlwaysBreakBeforeMultilineStrings: false 20 | AlwaysBreakTemplateDeclarations: true 21 | BinPackArguments: true 22 | BinPackParameters: true 23 | BreakBeforeBraces: Custom 24 | BraceWrapping: 25 | AfterClass: true 26 | AfterControlStatement: true 27 | AfterEnum: true 28 | AfterFunction: true 29 | AfterNamespace: false 30 | AfterObjCDeclaration: true 31 | AfterStruct: true 32 | AfterUnion: true 33 | BeforeCatch: true 34 | BeforeElse: true 35 | IndentBraces: false 36 | BreakBeforeBinaryOperators: None 37 | BreakBeforeTernaryOperators: true 38 | BreakConstructorInitializersBeforeComma: false 39 | ColumnLimit: 0 40 | CommentPragmas: '^ IWYU pragma:' 41 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 42 | ConstructorInitializerIndentWidth: 4 43 | ContinuationIndentWidth: 4 44 | Cpp11BracedListStyle: true 45 | DerivePointerAlignment: false 46 | DisableFormat: false 47 | ExperimentalAutoDetectBinPacking: false 48 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] 49 | IncludeCategories: 50 | - Regex: '^"(llvm|llvm-c|clang|clang-c)/' 51 | Priority: 2 52 | - Regex: '^(<|"(gtest|isl|json)/)' 53 | Priority: 3 54 | - Regex: '.*' 55 | Priority: 1 56 | IndentCaseLabels: false 57 | IndentWidth: 4 58 | IndentWrappedFunctionNames: false 59 | KeepEmptyLinesAtTheStartOfBlocks: true 60 | MacroBlockBegin: '' 61 | MacroBlockEnd: '' 62 | MaxEmptyLinesToKeep: 1 63 | NamespaceIndentation: None 64 | ObjCBlockIndentWidth: 2 65 | ObjCSpaceAfterProperty: false 66 | ObjCSpaceBeforeProtocolList: true 67 | PenaltyBreakBeforeFirstCallParameter: 19 68 | PenaltyBreakComment: 300 69 | PenaltyBreakFirstLessLess: 120 70 | PenaltyBreakString: 1000 71 | PenaltyExcessCharacter: 1000000 72 | PenaltyReturnTypeOnItsOwnLine: 60 73 | PointerAlignment: Left 74 | ReflowComments: true 75 | SortIncludes: false 76 | SpaceAfterCStyleCast: false 77 | SpaceBeforeAssignmentOperators: true 78 | SpaceBeforeParens: ControlStatements 79 | SpaceInEmptyParentheses: false 80 | SpacesBeforeTrailingComments: 1 81 | SpacesInAngles: false 82 | SpacesInContainerLiterals: true 83 | SpacesInCStyleCastParentheses: false 84 | SpacesInParentheses: false 85 | SpacesInSquareBrackets: false 86 | Standard: Cpp11 87 | TabWidth: 4 88 | UseTab: Never -------------------------------------------------------------------------------- /.clang-tidy: -------------------------------------------------------------------------------- 1 | --- 2 | Checks: '-*,clang-analyzer-*,-clang-analyzer-osx*,-clang-analyzer-optin.cplusplus.UninitializedObject' 3 | WarningsAsErrors: '*' 4 | HeaderFilterRegex: '\/src\/' 5 | AnalyzeTemporaryDtors: false 6 | CheckOptions: 7 | - key: google-readability-braces-around-statements.ShortStatementLines 8 | value: '1' 9 | - key: google-readability-function-size.StatementThreshold 10 | value: '800' 11 | - key: google-readability-namespace-comments.ShortNamespaceLines 12 | value: '10' 13 | - key: google-readability-namespace-comments.SpacesBeforeComments 14 | value: '2' 15 | - key: modernize-loop-convert.MaxCopySize 16 | value: '16' 17 | - key: modernize-loop-convert.MinConfidence 18 | value: reasonable 19 | - key: modernize-loop-convert.NamingStyle 20 | value: CamelCase 21 | - key: modernize-pass-by-value.IncludeStyle 22 | value: llvm 23 | - key: modernize-replace-auto-ptr.IncludeStyle 24 | value: llvm 25 | - key: modernize-use-nullptr.NullMacros 26 | value: 'NULL' 27 | ... 28 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | world_merc.json text eol=lf 2 | world_merc.converted.geojson text eol=lf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | archive 3 | build 4 | lib/binding 5 | lib/mapnik_settings.js 6 | node_modules 7 | src/*.*~ 8 | npm-debug.log 9 | test/tmp 10 | test/data/images/*actual* 11 | test/data/vector_tile/*actual* 12 | test/data/vector_tile/pasted/*actual* 13 | *.7z 14 | node.exe* 15 | *.pdb 16 | mapnik-sdk 17 | sdk 18 | foo 19 | local.env 20 | iwyu.sh 21 | package 22 | documentation 23 | .mason/ 24 | .toolchain/ 25 | mason_packages/ 26 | mason-postgis-config.env 27 | local-postgres/ 28 | postgres.log 29 | local-unix-socket/ 30 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/wagyu"] 2 | path = deps/wagyu 3 | url = https://github.com/mapbox/wagyu.git 4 | [submodule "deps/geometry"] 5 | path = deps/geometry 6 | url = https://github.com/mapbox/geometry.hpp.git 7 | [submodule "deps/protozero"] 8 | path = deps/protozero 9 | url = https://github.com/mapbox/protozero.git 10 | [submodule "deps/mapnik-vector-tile"] 11 | path = deps/mapnik-vector-tile 12 | url = https://github.com/mapnik/mapnik-vector-tile.git 13 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .gitattributes 2 | docs 3 | bench 4 | .gitignore 5 | .npmignore 6 | .gitmodules 7 | node_modules 8 | lib/binding 9 | build 10 | test 11 | benchmark 12 | configure 13 | Makefile 14 | .travis.yml 15 | appveyor.yml 16 | examples 17 | tools 18 | vcbuild.bat 19 | sdk 20 | package/src/mapnik_.cpp 21 | package/src/mapnik_.hpp 22 | *tgz 23 | foo 24 | iwyu.sh 25 | documentation 26 | package 27 | __nvm 28 | mason 29 | mason_packages 30 | deps/wagyu/tests 31 | deps/wagyu/docs 32 | deps/geometry/tests 33 | .toolchain 34 | local-postgres 35 | deps/protozero/test 36 | .mason 37 | mason-postgis-config.env 38 | local.env 39 | postgres.log 40 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | @mapnik:registry=https://npm.pkg.github.com 2 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2012, Dane Springmeyer 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following 12 | disclaimer in the documentation and/or other materials provided 13 | with the distribution. 14 | * Neither the name of the author nor the names of other 15 | contributors may be used to endorse or promote products derived 16 | from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /bench/boundary.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/bench/boundary.pbf -------------------------------------------------------------------------------- /bench/error/test_vt_abort.js: -------------------------------------------------------------------------------- 1 | var mapnik = require('../../lib'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var assert = require('assert'); 5 | var bytes = require('bytes'); 6 | 7 | var stats = { 8 | count:0, 9 | max_rss:0, 10 | max_heap:0 11 | } 12 | 13 | var collect_memstats = true; 14 | 15 | var vtile = new mapnik.VectorTile(16,33275,22518); 16 | vtile.addData(fs.readFileSync(path.join(__dirname,'../boundary.pbf'))); 17 | 18 | // This is a cheap way to create an excessively large vtile lazy buffer in memory 19 | // but please do not do this in real code. 20 | // NOTE: we do not call vtile.parse below since that would trigger a different memory 21 | // error (see test_vt_abort2.js) 22 | 23 | for (var i=0;i< 25;++i) { 24 | vtile.composite([vtile]); 25 | gc(); 26 | if (collect_memstats) { 27 | var mem = process.memoryUsage() 28 | if (mem.rss > stats.max_rss) stats.max_rss = mem.rss 29 | if (mem.heapUsed > stats.max_heap) stats.max_heap = mem.heapUsed 30 | } 31 | stats.count++; 32 | } 33 | 34 | try { 35 | 36 | /* 37 | 38 | Goal here is to protect against the below abort and instead have node-mapnik throw. 39 | 40 | Note: this abort appeared when https://github.com/mapnik/node-mapnik/issues/371 was fixed. 41 | 42 | FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() length exceeds max acceptable value 43 | Abort trap: 6 44 | 45 | Also on linux the error may be: 46 | 47 | node: ../src/node_buffer.cc:181: v8::Local node::Buffer::New(node::Environment*, const char*, size_t): Assertion `length <= kMaxLength' failed. 48 | 49 | more details https://github.com/mapnik/node-mapnik/issues/370 50 | 51 | */ 52 | 53 | var buf_len = vtile.getData().length; 54 | console.log("getData did not throw and instead returned buffer length of " + buf_len); 55 | } catch (err) { 56 | assert.ok(err.message.indexOf('Data is too large') > -1); 57 | console.log('Test success! (ran ' + stats.count + ' iterations)'); 58 | if (collect_memstats) { 59 | console.log("max mem: " + bytes(stats.max_rss) + '/' + stats.max_rss); 60 | console.log("max heap: " + bytes(stats.max_heap)); 61 | } 62 | process.exit(0) 63 | } 64 | 65 | console.log('Test failed, should have thrown and caught error but did not'); 66 | assert.ok(false) // should not get here 67 | -------------------------------------------------------------------------------- /bench/error/test_vt_abort2.js: -------------------------------------------------------------------------------- 1 | var mapnik = require('../../lib'); 2 | var path = require('path'); 3 | var fs = require('fs'); 4 | var assert = require('assert'); 5 | 6 | var vtile = new mapnik.VectorTile(16,33275,22518); 7 | vtile.addData(fs.readFileSync(path.join(__dirname,'../boundary.pbf'))); 8 | 9 | var error; 10 | var count = 0; 11 | for (var i=0;i< 20;++i) { 12 | vtile.composite([vtile]); 13 | // call parse to trigger a "too large" warning inside `google::protobuf::io::CodedInputStream::PrintTotalBytesLimitError` 14 | try { 15 | ++count; 16 | gc(); 17 | } catch (err) { 18 | error = err; 19 | break; 20 | } 21 | } 22 | 23 | /* 24 | 25 | Above we should at some point hit: 26 | 27 | [libprotobuf ERROR google/protobuf/io/coded_stream.cc:180] A protocol message was rejected because it was too big (more than 67108864 bytes). To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h. 28 | 29 | /Users/dane/projects/node-mapnik/bench/error/test_vt_abort2.js:14 30 | vtile.parse(); 31 | ^ 32 | Error: could not merge buffer as protobuf 33 | 34 | */ 35 | 36 | 37 | if (error) { 38 | assert.equal(error.message,'could not parse buffer as protobuf'); 39 | console.log('Test success! (ran ' + count + ' iterations)'); 40 | process.exit(0) 41 | } else { 42 | console.log('Test failed, should have thrown and caught error but did not'); 43 | assert.ok(false) // should not get here 44 | } 45 | -------------------------------------------------------------------------------- /bin/mapnik-index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | var binary = require('node-gyp-build'), 6 | path = require('path'), 7 | bindingPath = binary.path(__dirname + "/.."), 8 | program = path.join(path.dirname(bindingPath), 'bin', 'mapnik-index'), 9 | spawn = require('child_process').spawn, 10 | fs = require('fs'); 11 | 12 | if (!fs.existsSync(program)) { 13 | // assume it is not packaged but still on PATH 14 | program = 'mapnik-index'; 15 | } 16 | 17 | var proc = spawn(program, process.argv.slice(2)) 18 | .on('error', function(err) { 19 | if (err && err.code == 'ENOENT') { 20 | throw new Error("mapnik-index not found at " + program); 21 | } 22 | throw err; 23 | }) 24 | .on('exit', function(code) { 25 | process.exit(code); 26 | }); 27 | 28 | proc.stdout.pipe(process.stdout); 29 | proc.stderr.pipe(process.stderr); 30 | -------------------------------------------------------------------------------- /bin/mapnik-render.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | "use strict"; 4 | 5 | var fs = require('fs'); 6 | var path = require('path'); 7 | var child_process = require('child_process'); 8 | 9 | var usage = 'usage: render.js '; 10 | 11 | var stylesheet = process.argv[2]; 12 | if (!stylesheet) { 13 | console.log(usage); 14 | process.exit(1); 15 | } 16 | 17 | var image = process.argv[3]; 18 | if (!image) { 19 | console.log(usage); 20 | process.exit(1); 21 | } 22 | 23 | var mapnik = require('../'); 24 | 25 | mapnik.register_default_fonts(); 26 | mapnik.register_default_input_plugins(); 27 | 28 | function renderMap(stylesheet, image) { 29 | var map = new mapnik.Map(600, 400); 30 | map.loadSync(stylesheet,{strict:true}); 31 | map.zoomAll(); 32 | map.renderFileSync(image); 33 | child_process.exec('open', [image]); 34 | } 35 | 36 | if (path.extname(stylesheet).match(/.mml/i)) { 37 | try { 38 | var carto = require('carto'); 39 | new carto.Renderer({ 40 | filename: stylesheet, 41 | local_data_dir: path.dirname(stylesheet) 42 | }).render(fs.readFileSync(stylesheet, 'utf-8'), function(err, output) { 43 | if (err) { 44 | if (Array.isArray(err)) { 45 | err.forEach(function(e) { 46 | carto.writeError(e, {}); 47 | }); 48 | } 49 | process.exit(1); 50 | } else { 51 | fs.writeFileSync( 52 | stylesheet.replace('mml', 'xml'), 53 | output, 'utf-8'); 54 | stylesheet = stylesheet.replace('mml', 'xml'); 55 | renderMap(stylesheet, image); 56 | } 57 | }); 58 | } catch (e) { 59 | console.log('Carto is required to render .mml files.'); 60 | process.exit(1); 61 | } 62 | } else { 63 | renderMap(stylesheet, image); 64 | } 65 | -------------------------------------------------------------------------------- /bin/mapnik-shapeindex.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | var binary = require('node-gyp-build'), 6 | path = require('path'), 7 | bindingPath = binary.path(__dirname + "/.."), 8 | shapeindex = path.join(path.dirname(bindingPath), 'bin', 'shapeindex'), 9 | spawn = require('child_process').spawn, 10 | fs = require('fs'); 11 | 12 | if (!fs.existsSync(shapeindex)) { 13 | // assume it is not packaged but still on PATH 14 | shapeindex = 'shapeindex'; 15 | } 16 | 17 | var proc = spawn(shapeindex, process.argv.slice(2)) 18 | .on('error', function(err) { 19 | if (err && err.code == 'ENOENT') { 20 | throw new Error("shapeindex not found at " + shapeindex); 21 | } 22 | throw err; 23 | }) 24 | .on('exit', function(code) { 25 | process.exit(code); 26 | }); 27 | 28 | proc.stdout.pipe(process.stdout); 29 | proc.stderr.pipe(process.stderr); 30 | -------------------------------------------------------------------------------- /common.gypi: -------------------------------------------------------------------------------- 1 | { 2 | 'target_defaults': { 3 | 'default_configuration': 'Release', 4 | # the v140 refers to vs2015 5 | 'msbuild_toolset':'v140', 6 | 'msvs_disabled_warnings': [ 4503, 4068,4244,4005,4506,4345,4804,4805,4661 ], 7 | 'cflags_cc' : [ 8 | '-std=c++20', 9 | ], 10 | 'cflags_cc!': ['-std=gnu++0x','-fno-rtti', '-fno-exceptions'], 11 | 'configurations': { 12 | 'Debug': { 13 | 'defines!': [ 14 | 'NDEBUG' 15 | ], 16 | 'cflags_cc!': [ 17 | '-O3', 18 | '-Os', 19 | '-DNDEBUG', 20 | ], 21 | 'xcode_settings': { 22 | 'OTHER_CPLUSPLUSFLAGS!': [ 23 | '-O3', 24 | '-Os', 25 | '-DDEBUG' 26 | ], 27 | 'GCC_OPTIMIZATION_LEVEL': '0', 28 | 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES' 29 | }, 30 | 'msvs_settings': { 31 | 'VCCLCompilerTool': { 32 | 'ExceptionHandling': 1, # /EHsc 33 | 'RuntimeTypeInfo': 'true', # /GR 34 | 'RuntimeLibrary': '2', # /MD 35 | "AdditionalOptions": [ 36 | "/MP", # compile across multiple CPUs 37 | "/bigobj", #compiling: x86 fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj 38 | ], 39 | } 40 | } 41 | }, 42 | 'Release': { 43 | 'defines': [ 44 | 'NDEBUG' 45 | ], 46 | 'xcode_settings': { 47 | 'OTHER_CPLUSPLUSFLAGS!': [ 48 | '-Os', 49 | '-O2' 50 | ], 51 | 'GCC_OPTIMIZATION_LEVEL': '3', 52 | 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', 53 | 'DEAD_CODE_STRIPPING': 'YES', 54 | 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES' 55 | }, 56 | 'msvs_settings': { 57 | 'VCCLCompilerTool': { 58 | 'ExceptionHandling': 1, # /EHsc 59 | 'RuntimeTypeInfo': 'true', # /GR 60 | 'RuntimeLibrary': '2', # /MD 61 | "AdditionalOptions": [ 62 | "/MP", # compile across multiple CPUs 63 | "/bigobj", #compiling: x86 fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj 64 | ], 65 | "DebugInformationFormat": "3" 66 | }, 67 | "VCLinkerTool": { 68 | "GenerateDebugInformation": "true", 69 | "ProgramDatabaseFile": "$(OutDir)$(TargetName)$(TargetExt).pdb", 70 | } 71 | } 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@mapnik/mapnik", 3 | "description": "Node.js bindings for Mapnik (mapnik.org)", 4 | "url": "http://github.com/mapnik/node-mapnik", 5 | "homepage": "http://mapnik.org", 6 | "author": "Dane Springmeyer ", 7 | "version": "4.6.10", 8 | "main": "index.js", 9 | "directories": { 10 | "share": "./share", 11 | "fonts": "./lib/mapnik/fonts" 12 | }, 13 | "private": false, 14 | "bugs": { 15 | "email": "artem@mapnik.org", 16 | "url": "http://github.com/mapnik/node-mapnik/issues" 17 | }, 18 | "keywords": [ 19 | "map", 20 | "graphics", 21 | "canvas", 22 | "tile", 23 | "mapnik", 24 | "carto" 25 | ], 26 | "repository": { 27 | "type": "git", 28 | "url": "git://github.com/mapnik/node-mapnik.git" 29 | }, 30 | "contributors": [ 31 | "Konstantin Käfer", 32 | "Blake Thompson", 33 | "Artem Pavlenko" 34 | ], 35 | "license": "BSD-3-Clause", 36 | "dependencies": { 37 | "node-addon-api": "^8.3.1", 38 | "node-gyp-build": "^4.8.4", 39 | "prebuildify": "^6.0.1" 40 | }, 41 | "optionalDependencies": { 42 | "@mapnik/core-darwin-arm64": "4.0.7", 43 | "@mapnik/core-darwin-x64": "4.0.7", 44 | "@mapnik/core-linux-arm64": "4.0.7", 45 | "@mapnik/core-linux-x64": "4.0.7" 46 | }, 47 | "bin": { 48 | "mapnik-index.js": "bin/mapnik-index.js", 49 | "mapnik-inspect.js": "bin/mapnik-inspect.js", 50 | "mapnik-render.js": "bin/mapnik-render.js", 51 | "mapnik-shapeindex.js": "bin/mapnik-shapeindex.js" 52 | }, 53 | "scripts": { 54 | "test": "tape test/*.test.js", 55 | "install": "node-gyp-build", 56 | "prebuildify": "prebuildify --napi --strip", 57 | "preinstall" : "./scripts/preinstall.sh", 58 | "postinstall": "./scripts/postinstall.sh" 59 | }, 60 | "devDependencies": { 61 | "tape": "^v5.8.1" 62 | }, 63 | "jshintConfig": { 64 | "node": true, 65 | "globalstrict": true, 66 | "undef": true, 67 | "unused": true, 68 | "noarg": true, 69 | "mocha": true 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /scripts/postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu 3 | set -o pipefail 4 | MODULE_PATH=$(node -e "console.log(path.dirname(require('node-gyp-build').path()))") 5 | echo "MODULE_PATH:${MODULE_PATH}" 6 | 7 | if [[ ! ${MODULE_PATH} == *"node_modules"* ]]; then 8 | echo -e "\033[36mAssuming local install\033[0m" 9 | echo -e "\033[35mMODULE_PATH:${MODULE_PATH}\033[0m" 10 | echo " 11 | var path = require('path'); 12 | module.exports.paths = { 13 | 'fonts': '$(mapnik-config --fonts)', 14 | 'input_plugins': '$(mapnik-config --input-plugins)', 15 | 'mapnik_index': '$(which mapnik-index)', 16 | 'shape_index': '$(which shapeindex)' 17 | }; 18 | module.exports.env = { 19 | 'ICU_DATA': '$(mapnik-config --icu-data)', 20 | 'GDAL_DATA': '$(mapnik-config --gdal-data)', 21 | 'PROJ_LIB': '$(mapnik-config --proj-lib)' 22 | }; 23 | " > ${MODULE_PATH}/mapnik_settings.js 24 | cd ${MODULE_PATH} 25 | ln -sf $(mapnik-config --prefix)/bin . 26 | ln -sf $(mapnik-config --prefix)/lib . 27 | exit 0 28 | fi 29 | -------------------------------------------------------------------------------- /scripts/preinstall.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu 3 | set -o pipefail 4 | 5 | MODULE_PATH=$(node -e "console.log(path.dirname(require('node-gyp-build').path()))") 6 | PLATFORM=$(node -e "console.log(process.platform)") 7 | ARCH=$(node -e "console.log(process.arch)") 8 | MAPNIK_VERSION=$(node -e "console.log(require('./package.json').optionalDependencies['@mapnik/core-${PLATFORM}-${ARCH}'])") 9 | 10 | if [ -z ${MAPNIK_VERSION+x} ]; then 11 | echo -e "\033[31m Mapnik core package v${MAPNIK_VERSION} is not available for ${PLATFORM}+${ARCH}\033[0m" 12 | exit 1 13 | fi 14 | 15 | NODE_MODULES_DIR=${MODULE_PATH%%/node_modules/*}/node_modules 16 | MAPNIK_CORE_PATH=${NODE_MODULES_DIR}/@mapnik/core-${PLATFORM}-${ARCH} 17 | #echo -e "\033[36mMODULE_PATH:${MODULE_PATH}\033[0m" 18 | #echo -e "\033[36mMAPNIK_CORE_PATH:${MAPNIK_CORE_PATH}\033[0m" 19 | 20 | if [[ ! -d $MAPNIK_CORE_PATH ]]; then 21 | echo -e "\033[36mMissing Mapnik Core package - @mapnik/core-${PLATFORM}-${ARCH}-${MAPNIK_VERSION}\033[0m" 22 | echo -e "\033[36mAttempting to build using local mapnik...\033[0m" 23 | MAPNIK_VERSION=$(mapnik-config -v) 24 | exit 0 25 | fi 26 | 27 | cd ${MODULE_PATH} 28 | ln -sf ${MAPNIK_CORE_PATH}/bin . 29 | ln -sf ${MAPNIK_CORE_PATH}/lib . 30 | 31 | # # generate mapnik_settings.js 32 | echo " 33 | var path = require('path'); 34 | module.exports.paths = { 35 | 'fonts': path.join(__dirname, '../../lib/mapnik/fonts'), 36 | 'input_plugins': path.join(__dirname, 'lib/mapnik/input'), 37 | 'mapnik_index': path.join(__dirname, 'bin/mapnik-index'), 38 | 'shape_index': path.join(__dirname, 'bin/shapeindex') 39 | }; 40 | module.exports.env = { 41 | 'ICU_DATA': path.join(__dirname, '../../share/icu'), 42 | 'GDAL_DATA': path.join(__dirname, '../../share/gdal'), 43 | 'PROJ_LIB': path.join(__dirname, '../../share/proj') 44 | }; 45 | " > ${MODULE_PATH}/mapnik_settings.js 46 | -------------------------------------------------------------------------------- /src/blend.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // stl 5 | #include 6 | #include 7 | #include 8 | #include "mapnik_palette.hpp" 9 | #include "mapnik_image.hpp" 10 | #include "tint.hpp" 11 | 12 | namespace node_mapnik { 13 | 14 | struct BImage 15 | { 16 | BImage() : data(nullptr), 17 | dataLength(0), 18 | x(0), 19 | y(0), 20 | width(0), 21 | height(0), 22 | tint(), 23 | im_ptr(nullptr), 24 | im_raw_ptr(nullptr), 25 | im_obj(nullptr) {} 26 | 27 | Napi::Reference> buffer; 28 | char const* data; 29 | size_t dataLength; 30 | int x; 31 | int y; 32 | int width, height; 33 | Tinter tint; 34 | std::unique_ptr im_ptr; 35 | mapnik::image_rgba8* im_raw_ptr; 36 | image_ptr im_obj; 37 | }; 38 | 39 | typedef std::shared_ptr ImagePtr; 40 | typedef std::vector Images; 41 | 42 | enum BlendFormat 43 | { 44 | BLEND_FORMAT_PNG, 45 | BLEND_FORMAT_JPEG, 46 | BLEND_FORMAT_WEBP 47 | }; 48 | 49 | enum AlphaMode 50 | { 51 | BLEND_MODE_OCTREE, 52 | BLEND_MODE_HEXTREE 53 | }; 54 | 55 | Napi::Value rgb2hsl(Napi::CallbackInfo const& info); 56 | Napi::Value hsl2rgb(Napi::CallbackInfo const& info); 57 | Napi::Value blend(Napi::CallbackInfo const& info); 58 | 59 | } // namespace node_mapnik 60 | -------------------------------------------------------------------------------- /src/mapnik_cairo_surface.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.hpp" 2 | #include "mapnik_cairo_surface.hpp" 3 | 4 | Napi::FunctionReference CairoSurface::constructor; 5 | 6 | Napi::Object CairoSurface::Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr) 7 | { 8 | // clang-format off 9 | Napi::Function func = DefineClass(env, "CairoSurface", { 10 | InstanceMethod<&CairoSurface::width>("width", prop_attr), 11 | InstanceMethod<&CairoSurface::height>("height", prop_attr), 12 | InstanceMethod<&CairoSurface::getData>("getData", prop_attr) 13 | }); 14 | // clang-format on 15 | constructor = Napi::Persistent(func); 16 | constructor.SuppressDestruct(); 17 | exports.Set("CairoSurface", func); 18 | return exports; 19 | } 20 | 21 | // ctor 22 | CairoSurface::CairoSurface(Napi::CallbackInfo const& info) 23 | : Napi::ObjectWrap(info) 24 | { 25 | Napi::Env env = info.Env(); 26 | if (info.Length() == 3) 27 | { 28 | if (!info[0].IsString()) 29 | { 30 | Napi::TypeError::New(env, "CairoSurface 'format' must be a string").ThrowAsJavaScriptException(); 31 | return; 32 | } 33 | format_ = info[0].As(); 34 | if (!info[1].IsNumber() || !info[2].IsNumber()) 35 | { 36 | Napi::TypeError::New(env, "CairoSurface 'width' and 'height' must be integers").ThrowAsJavaScriptException(); 37 | return; 38 | } 39 | width_ = info[1].As().Int32Value(); 40 | height_ = info[2].As().Int32Value(); 41 | } 42 | else 43 | { 44 | Napi::Error::New(env, "CairoSurface requires three arguments: format, width, and height").ThrowAsJavaScriptException(); 45 | } 46 | } 47 | 48 | Napi::Value CairoSurface::width(Napi::CallbackInfo const& info) 49 | { 50 | Napi::Env env = info.Env(); 51 | return Napi::Number::New(env, width_); 52 | } 53 | 54 | Napi::Value CairoSurface::height(Napi::CallbackInfo const& info) 55 | { 56 | Napi::Env env = info.Env(); 57 | return Napi::Number::New(env, height_); 58 | } 59 | 60 | Napi::Value CairoSurface::getData(Napi::CallbackInfo const& info) 61 | { 62 | Napi::Env env = info.Env(); 63 | Napi::EscapableHandleScope scope(env); 64 | if (!data_.empty()) return scope.Escape(Napi::String::New(env, data_)); 65 | std::string str = stream_.str(); 66 | return scope.Escape(Napi::String::New(env, str)); 67 | } 68 | -------------------------------------------------------------------------------- /src/mapnik_cairo_surface.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | // stl 5 | #include 6 | // cairo 7 | #if defined(HAVE_CAIRO) 8 | #include 9 | #else 10 | #define cairo_status_t int 11 | #endif 12 | 13 | class CairoSurface : public Napi::ObjectWrap 14 | { 15 | public: 16 | // initializer 17 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 18 | // ctor 19 | explicit CairoSurface(Napi::CallbackInfo const& info); 20 | // methods 21 | Napi::Value getData(Napi::CallbackInfo const& info); 22 | Napi::Value width(Napi::CallbackInfo const& info); 23 | Napi::Value height(Napi::CallbackInfo const& info); 24 | static cairo_status_t write_callback(void* stream, 25 | const unsigned char* data, 26 | unsigned int length) 27 | { 28 | #if defined(HAVE_CAIRO) 29 | if (!stream) 30 | { 31 | // Since the closure here is the passing of the std::stringstream "i_stream" of this 32 | // class it is unlikely that this could ever be reached unless something was very wrong 33 | // and went out of scope, aka it was improperly programmed. Therefore, it is not possible 34 | // to reach this point with standard testing. 35 | // LCOV_EXCL_START 36 | return CAIRO_STATUS_WRITE_ERROR; 37 | // LCOV_EXCL_STOP 38 | } 39 | std::stringstream* fin = reinterpret_cast(stream); 40 | *fin << std::string((const char*)data, (size_t)length); 41 | return CAIRO_STATUS_SUCCESS; 42 | #else 43 | return CAIRO_STATUS_WRITE_ERROR; 44 | #endif 45 | } 46 | 47 | inline unsigned width() const { return width_; } 48 | inline unsigned height() const { return height_; } 49 | inline std::string const& format() const { return format_; } 50 | inline std::stringstream& stream() { return stream_; } 51 | inline void flush() { data_ = stream_.str(); } 52 | inline void set_data(std::string const& data) { data_ = data; } 53 | inline std::string const& data() const { return data_; } 54 | static Napi::FunctionReference constructor; 55 | 56 | private: 57 | unsigned width_; 58 | unsigned height_; 59 | std::string format_; 60 | std::stringstream stream_; 61 | std::string data_; 62 | }; 63 | -------------------------------------------------------------------------------- /src/mapnik_color.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class Color : public Napi::ObjectWrap 7 | { 8 | friend class Image; 9 | friend class ImageView; 10 | friend class Map; 11 | 12 | public: 13 | // initializer 14 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 15 | // ctor 16 | explicit Color(Napi::CallbackInfo const& info); 17 | // methods 18 | Napi::Value toString(Napi::CallbackInfo const& info); 19 | Napi::Value hex(Napi::CallbackInfo const& info); 20 | // accessors 21 | Napi::Value red(Napi::CallbackInfo const& info); 22 | void red(Napi::CallbackInfo const& info, Napi::Value const& value); 23 | Napi::Value green(Napi::CallbackInfo const& info); 24 | void green(Napi::CallbackInfo const& info, Napi::Value const& value); 25 | Napi::Value blue(Napi::CallbackInfo const& info); 26 | void blue(Napi::CallbackInfo const& info, Napi::Value const& value); 27 | Napi::Value alpha(Napi::CallbackInfo const& info); 28 | void alpha(Napi::CallbackInfo const& info, Napi::Value const& value); 29 | Napi::Value premultiplied(Napi::CallbackInfo const& info); 30 | void premultiplied(Napi::CallbackInfo const& info, Napi::Value const& value); 31 | 32 | private: 33 | static Napi::FunctionReference constructor; 34 | mapnik::color color_; 35 | }; 36 | -------------------------------------------------------------------------------- /src/mapnik_datasource.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace mapnik { 7 | class datasource; 8 | } 9 | 10 | using datasource_ptr = std::shared_ptr; 11 | 12 | class Datasource : public Napi::ObjectWrap 13 | { 14 | friend class Layer; 15 | 16 | public: 17 | //initilizer 18 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 19 | // ctor 20 | explicit Datasource(Napi::CallbackInfo const& info); 21 | // methods 22 | Napi::Value parameters(Napi::CallbackInfo const& info); 23 | Napi::Value describe(Napi::CallbackInfo const& info); 24 | Napi::Value featureset(Napi::CallbackInfo const& info); 25 | Napi::Value extent(Napi::CallbackInfo const& info); 26 | Napi::Value fields(Napi::CallbackInfo const& info); 27 | inline datasource_ptr impl() { return datasource_; } 28 | 29 | private: 30 | static Napi::FunctionReference constructor; 31 | datasource_ptr datasource_; 32 | }; 33 | -------------------------------------------------------------------------------- /src/mapnik_expression.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | // mapnik 5 | #include 6 | 7 | class Expression : public Napi::ObjectWrap 8 | { 9 | public: 10 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 11 | explicit Expression(Napi::CallbackInfo const& info); 12 | Napi::Value toString(Napi::CallbackInfo const& info); 13 | Napi::Value evaluate(Napi::CallbackInfo const& info); 14 | 15 | private: 16 | static Napi::FunctionReference constructor; 17 | mapnik::expression_ptr expression_; 18 | }; 19 | -------------------------------------------------------------------------------- /src/mapnik_feature.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // stl 3 | #include 4 | 5 | // mapnik 6 | #include 7 | #include 8 | // 9 | #include 10 | 11 | class Feature : public Napi::ObjectWrap 12 | { 13 | public: 14 | // initialiser 15 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 16 | // ctor 17 | explicit Feature(Napi::CallbackInfo const& info); 18 | // methods 19 | static Napi::Value fromJSON(Napi::CallbackInfo const& info); 20 | Napi::Value id(Napi::CallbackInfo const& info); 21 | Napi::Value extent(Napi::CallbackInfo const& info); 22 | Napi::Value attributes(Napi::CallbackInfo const& info); 23 | Napi::Value geometry(Napi::CallbackInfo const& info); 24 | Napi::Value toJSON(Napi::CallbackInfo const& info); 25 | inline mapnik::feature_ptr impl() const { return feature_; } 26 | static Napi::FunctionReference constructor; 27 | 28 | private: 29 | mapnik::feature_ptr feature_; 30 | mapnik::context_ptr ctx_; 31 | }; 32 | -------------------------------------------------------------------------------- /src/mapnik_featureset.cpp: -------------------------------------------------------------------------------- 1 | #include "mapnik_featureset.hpp" 2 | #include "mapnik_feature.hpp" 3 | 4 | Napi::FunctionReference Featureset::constructor; 5 | 6 | Napi::Object Featureset::Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr) 7 | { 8 | // clang-format off 9 | Napi::Function func = DefineClass(env, "Featureset", { 10 | InstanceMethod<&Featureset::next>("next", prop_attr) 11 | }); 12 | // clang-format on 13 | constructor = Napi::Persistent(func); 14 | constructor.SuppressDestruct(); 15 | exports.Set("Featureset", func); 16 | return exports; 17 | } 18 | 19 | /** 20 | * **`mapnik.Featureset`** 21 | * 22 | * An iterator of {@link mapnik.Feature} objects. 23 | * 24 | * @class Featureset 25 | */ 26 | 27 | Featureset::Featureset(Napi::CallbackInfo const& info) 28 | : Napi::ObjectWrap(info) 29 | { 30 | Napi::Env env = info.Env(); 31 | if (info.Length() == 1 && info[0].IsExternal()) 32 | { 33 | auto ext = info[0].As>(); 34 | if (ext) featureset_ = *ext.Data(); 35 | return; 36 | } 37 | Napi::TypeError::New(env, "Sorry a Featureset cannot currently be created, only accessed via an existing datasource") 38 | .ThrowAsJavaScriptException(); 39 | } 40 | 41 | /** 42 | * Return the next Feature in this featureset if it exists, or `null` if it 43 | * does not. 44 | * 45 | * @name next 46 | * @instance 47 | * @memberof Featureset 48 | * @returns {mapnik.Feature|null} next feature 49 | */ 50 | Napi::Value Featureset::next(Napi::CallbackInfo const& info) 51 | { 52 | Napi::Env env = info.Env(); 53 | Napi::EscapableHandleScope scope(env); 54 | 55 | if (featureset_) 56 | { 57 | mapnik::feature_ptr feature; 58 | try 59 | { 60 | feature = featureset_->next(); 61 | } 62 | catch (std::exception const& ex) 63 | { 64 | // It is not immediately obvious how this could cause an exception, a check of featureset plugin 65 | // implementations resulted in no obvious way that an exception could be raised. Therefore, it 66 | // is not obvious currently what could raise this exception. However, since a plugin could possibly 67 | // be developed outside of mapnik core plugins that could raise here we are probably best still 68 | // wrapping this in a try catch. 69 | /* LCOV_EXCL_START */ 70 | Napi::Error::New(env, ex.what()).ThrowAsJavaScriptException(); 71 | return env.Undefined(); 72 | /* LCOV_EXCL_STOP */ 73 | } 74 | if (feature) 75 | { 76 | Napi::Value arg = Napi::External::New(env, &feature); 77 | Napi::Object obj = Feature::constructor.New({arg}); 78 | return scope.Escape(obj); 79 | } 80 | } 81 | return env.Null(); // Loop termination condition 82 | } 83 | -------------------------------------------------------------------------------- /src/mapnik_featureset.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | using featureset_ptr = mapnik::featureset_ptr; 7 | namespace detail { 8 | struct AsyncQueryPoint; 9 | } 10 | 11 | class Featureset : public Napi::ObjectWrap 12 | { 13 | friend class Datasource; 14 | friend struct detail::AsyncQueryPoint; 15 | 16 | public: 17 | // initialiser 18 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 19 | // ctor 20 | explicit Featureset(Napi::CallbackInfo const& info); 21 | // methods 22 | Napi::Value next(Napi::CallbackInfo const& info); 23 | 24 | private: 25 | static Napi::FunctionReference constructor; 26 | featureset_ptr featureset_; 27 | }; 28 | -------------------------------------------------------------------------------- /src/mapnik_geometry.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // mapnik 4 | #include 5 | // 6 | #include 7 | 8 | class Geometry : public Napi::ObjectWrap 9 | { 10 | friend class Feature; 11 | 12 | public: 13 | // initializer 14 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 15 | // ctor 16 | explicit Geometry(Napi::CallbackInfo const& info); 17 | // methods 18 | Napi::Value type(Napi::CallbackInfo const& info); 19 | Napi::Value extent(Napi::CallbackInfo const& info); 20 | Napi::Value toWKB(Napi::CallbackInfo const& info); 21 | Napi::Value toWKT(Napi::CallbackInfo const& info); 22 | Napi::Value toJSON(Napi::CallbackInfo const& info); 23 | Napi::Value toJSONSync(Napi::CallbackInfo const& info); 24 | inline mapnik::geometry::geometry const& geometry() 25 | { 26 | return feature_->get_geometry(); 27 | } 28 | 29 | private: 30 | static Napi::FunctionReference constructor; 31 | mapnik::feature_ptr feature_; 32 | }; 33 | -------------------------------------------------------------------------------- /src/mapnik_grid.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(GRID_RENDERER) 4 | 5 | #include 6 | // mapnik 7 | #include 8 | // stl 9 | #include 10 | 11 | using grid_ptr = std::shared_ptr; 12 | 13 | class Grid : public Napi::ObjectWrap 14 | { 15 | public: 16 | // initializer 17 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 18 | // ctor 19 | explicit Grid(Napi::CallbackInfo const& info); 20 | // methods 21 | Napi::Value encodeSync(Napi::CallbackInfo const& info); 22 | Napi::Value encode(Napi::CallbackInfo const& info); 23 | Napi::Value addField(Napi::CallbackInfo const& info); 24 | Napi::Value fields(Napi::CallbackInfo const& info); 25 | Napi::Value view(Napi::CallbackInfo const& info); 26 | Napi::Value width(Napi::CallbackInfo const& info); 27 | Napi::Value height(Napi::CallbackInfo const& info); 28 | Napi::Value painted(Napi::CallbackInfo const& info); 29 | Napi::Value clearSync(Napi::CallbackInfo const& info); 30 | Napi::Value clear(Napi::CallbackInfo const& info); 31 | Napi::Value key(Napi::CallbackInfo const& info); 32 | void key(Napi::CallbackInfo const& info, const Napi::Value& value); 33 | inline grid_ptr impl() const { return grid_; } 34 | static Napi::FunctionReference constructor; 35 | 36 | private: 37 | grid_ptr grid_; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/mapnik_grid_view.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(GRID_RENDERER) 4 | 5 | #include 6 | // mapnik 7 | #include 8 | // stl 9 | #include 10 | #include "mapnik_grid.hpp" 11 | 12 | class Grid; 13 | 14 | typedef std::shared_ptr grid_view_ptr; 15 | 16 | class GridView : public Napi::ObjectWrap 17 | { 18 | friend class Grid; 19 | 20 | public: 21 | // initializer 22 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 23 | // ctor 24 | explicit GridView(Napi::CallbackInfo const& info); 25 | // methods 26 | Napi::Value encodeSync(Napi::CallbackInfo const& info); 27 | Napi::Value encode(Napi::CallbackInfo const& info); 28 | Napi::Value fields(Napi::CallbackInfo const& info); 29 | Napi::Value width(Napi::CallbackInfo const& info); 30 | Napi::Value height(Napi::CallbackInfo const& info); 31 | Napi::Value isSolid(Napi::CallbackInfo const& info); 32 | Napi::Value isSolidSync(Napi::CallbackInfo const& info); 33 | Napi::Value getPixel(Napi::CallbackInfo const& info); 34 | inline grid_view_ptr impl() const { return grid_view_; } 35 | 36 | private: 37 | static Napi::FunctionReference constructor; 38 | grid_view_ptr grid_view_; 39 | grid_ptr grid_; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/mapnik_image_clear.cpp: -------------------------------------------------------------------------------- 1 | #include // for image types 2 | #include // for image_any 3 | #include // for save_to_string, guess_type, etc 4 | 5 | #include "mapnik_image.hpp" 6 | 7 | namespace detail { 8 | 9 | // AsyncWorker 10 | 11 | struct AsyncClear : Napi::AsyncWorker 12 | { 13 | using Base = Napi::AsyncWorker; 14 | AsyncClear(image_ptr const& image, Napi::Function const& callback) 15 | : Base(callback), 16 | image_(image) 17 | { 18 | } 19 | 20 | void Execute() override 21 | { 22 | mapnik::fill(*image_, 0); 23 | } 24 | 25 | std::vector GetResult(Napi::Env env) override 26 | { 27 | if (image_) 28 | { 29 | Napi::Value arg = Napi::External::New(env, &image_); 30 | Napi::Object obj = Image::constructor.New({arg}); 31 | return {env.Null(), napi_value(obj)}; 32 | } 33 | return Base::GetResult(env); 34 | } 35 | image_ptr image_; 36 | }; 37 | } // namespace detail 38 | 39 | /** 40 | * Make this image transparent. (synchronous) 41 | * 42 | * @name clearSync 43 | * @instance 44 | * @memberof Image 45 | * @example 46 | * var img = new mapnik.Image(5,5); 47 | * img.fillSync(1); 48 | * console.log(img.getPixel(0, 0)); // 1 49 | * img.clearSync(); 50 | * console.log(img.getPixel(0, 0)); // 0 51 | */ 52 | 53 | Napi::Value Image::clearSync(Napi::CallbackInfo const& info) 54 | { 55 | Napi::Env env = info.Env(); 56 | try 57 | { 58 | mapnik::fill(*image_, 0); 59 | } 60 | catch (std::exception const& ex) 61 | { 62 | Napi::Error::New(env, ex.what()).ThrowAsJavaScriptException(); 63 | } 64 | return env.Undefined(); 65 | } 66 | 67 | /** 68 | * Make this image transparent, removing all image data from it. 69 | * 70 | * @name clear 71 | * @instance 72 | * @param {Function} callback 73 | * @memberof Image 74 | * @example 75 | * var img = new mapnik.Image(5,5); 76 | * img.fillSync(1); 77 | * console.log(img.getPixel(0, 0)); // 1 78 | * img.clear(function(err, result) { 79 | * console.log(result.getPixel(0,0)); // 0 80 | * }); 81 | */ 82 | 83 | Napi::Value Image::clear(Napi::CallbackInfo const& info) 84 | { 85 | if (info.Length() == 0) 86 | { 87 | return clearSync(info); 88 | } 89 | Napi::Env env = info.Env(); 90 | // ensure callback is a function 91 | Napi::Value callback_val = info[info.Length() - 1]; 92 | if (!callback_val.IsFunction()) 93 | { 94 | Napi::TypeError::New(env, "last argument must be a callback function").ThrowAsJavaScriptException(); 95 | return env.Undefined(); 96 | } 97 | 98 | auto* worker = new detail::AsyncClear{image_, callback_val.As()}; 99 | worker->Queue(); 100 | return env.Undefined(); 101 | } 102 | -------------------------------------------------------------------------------- /src/mapnik_image_view.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | // mapnik 5 | #include // for image_rgba8 6 | #include 7 | 8 | class Image; 9 | namespace mapnik { 10 | template 11 | class image_view; 12 | } 13 | 14 | typedef std::shared_ptr image_view_ptr; 15 | 16 | class ImageView : public Napi::ObjectWrap 17 | { 18 | friend class Image; 19 | 20 | public: 21 | // initializer 22 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 23 | // ctor 24 | explicit ImageView(Napi::CallbackInfo const& info); 25 | // methods 26 | Napi::Value encodeSync(Napi::CallbackInfo const& info); 27 | Napi::Value encode(Napi::CallbackInfo const& info); 28 | Napi::Value width(Napi::CallbackInfo const& info); 29 | Napi::Value height(Napi::CallbackInfo const& info); 30 | void saveSync(Napi::CallbackInfo const& info); 31 | Napi::Value isSolid(Napi::CallbackInfo const& info); 32 | Napi::Value isSolidSync(Napi::CallbackInfo const& info); 33 | Napi::Value getPixel(Napi::CallbackInfo const& info); 34 | 35 | private: 36 | static void encode_common_args_(Napi::CallbackInfo const& info, std::string& format, palette_ptr& palette); 37 | static Napi::FunctionReference constructor; 38 | image_view_ptr image_view_; 39 | image_ptr image_; 40 | Napi::Reference> buf_ref_; 41 | }; 42 | -------------------------------------------------------------------------------- /src/mapnik_layer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | // stl 5 | #include 6 | 7 | namespace mapnik { 8 | class layer; 9 | } 10 | 11 | using layer_ptr = std::shared_ptr; 12 | 13 | class Layer : public Napi::ObjectWrap 14 | { 15 | friend class Map; 16 | 17 | public: 18 | // initializer 19 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 20 | // ctor 21 | explicit Layer(Napi::CallbackInfo const& info); 22 | // methods 23 | Napi::Value describe(Napi::CallbackInfo const& info); 24 | // accessors 25 | Napi::Value name(Napi::CallbackInfo const& info); 26 | void name(Napi::CallbackInfo const& info, Napi::Value const& value); 27 | Napi::Value styles(Napi::CallbackInfo const& info); 28 | void styles(Napi::CallbackInfo const& info, Napi::Value const& value); 29 | Napi::Value active(Napi::CallbackInfo const& info); 30 | void active(Napi::CallbackInfo const& info, Napi::Value const& value); 31 | Napi::Value srs(Napi::CallbackInfo const& info); 32 | void srs(Napi::CallbackInfo const& info, Napi::Value const& value); 33 | Napi::Value datasource(Napi::CallbackInfo const& info); 34 | void datasource(Napi::CallbackInfo const& info, Napi::Value const& value); 35 | Napi::Value minimum_scale_denominator(Napi::CallbackInfo const& info); 36 | void minimum_scale_denominator(Napi::CallbackInfo const& info, Napi::Value const& value); 37 | Napi::Value maximum_scale_denominator(Napi::CallbackInfo const& info); 38 | void maximum_scale_denominator(Napi::CallbackInfo const& info, Napi::Value const& value); 39 | Napi::Value queryable(Napi::CallbackInfo const& info); 40 | void queryable(Napi::CallbackInfo const& info, Napi::Value const& value); 41 | Napi::Value clear_label_cache(Napi::CallbackInfo const& info); 42 | void clear_label_cache(Napi::CallbackInfo const& info, Napi::Value const& value); 43 | inline layer_ptr impl() const { return layer_; } 44 | 45 | private: 46 | static Napi::FunctionReference constructor; 47 | layer_ptr layer_; 48 | }; 49 | -------------------------------------------------------------------------------- /src/mapnik_logger.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace mapnik { 5 | class logger; 6 | } 7 | 8 | class Logger : public Napi::ObjectWrap 9 | { 10 | public: 11 | // initializer 12 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 13 | 14 | // ctor 15 | explicit Logger(Napi::CallbackInfo const& info); 16 | 17 | // Get and set functions 18 | // Are these the only methods available in logger? 19 | static Napi::Value get_severity(Napi::CallbackInfo const& info); 20 | static Napi::Value set_severity(Napi::CallbackInfo const& info); 21 | 22 | private: 23 | static Napi::FunctionReference constructor; 24 | }; 25 | -------------------------------------------------------------------------------- /src/mapnik_palette.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | using palette_ptr = std::shared_ptr; 8 | 9 | class Palette : public Napi::ObjectWrap 10 | { 11 | friend class Image; 12 | friend class ImageView; 13 | friend class Map; 14 | 15 | public: 16 | // initializer 17 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 18 | // ctor 19 | explicit Palette(Napi::CallbackInfo const& info); 20 | // methods 21 | Napi::Value toString(Napi::CallbackInfo const& info); 22 | Napi::Value toBuffer(Napi::CallbackInfo const& info); 23 | inline palette_ptr palette() { return palette_; } 24 | 25 | private: 26 | static Napi::FunctionReference constructor; 27 | palette_ptr palette_; 28 | }; 29 | -------------------------------------------------------------------------------- /src/mapnik_projection.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | // stl 5 | #include 6 | #include 7 | 8 | namespace mapnik { 9 | class proj_transform; 10 | } 11 | namespace mapnik { 12 | class projection; 13 | } 14 | 15 | using proj_ptr = std::shared_ptr; 16 | 17 | class Projection : public Napi::ObjectWrap 18 | { 19 | friend class ProjTransform; 20 | 21 | public: 22 | // initializer 23 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 24 | // ctorx 25 | explicit Projection(Napi::CallbackInfo const& info); 26 | // methods 27 | Napi::Value inverse(Napi::CallbackInfo const& info); 28 | Napi::Value forward(Napi::CallbackInfo const& info); 29 | Napi::Value definition(Napi::CallbackInfo const& info); 30 | Napi::Value description(Napi::CallbackInfo const& info); 31 | Napi::Value area_of_use(Napi::CallbackInfo const& info); 32 | private: 33 | static Napi::FunctionReference constructor; 34 | proj_ptr projection_; 35 | }; 36 | 37 | using proj_tr_ptr = std::shared_ptr; 38 | 39 | class ProjTransform : public Napi::ObjectWrap 40 | { 41 | friend class Geometry; 42 | 43 | public: 44 | // initializer 45 | static Napi::Object Initialize(Napi::Env env, Napi::Object exports, napi_property_attributes prop_attr); 46 | // ctor 47 | explicit ProjTransform(Napi::CallbackInfo const& info); 48 | // methods 49 | Napi::Value forward(Napi::CallbackInfo const& info); 50 | Napi::Value backward(Napi::CallbackInfo const& info); 51 | inline proj_tr_ptr impl() { return proj_transform_; } 52 | 53 | private: 54 | static Napi::FunctionReference constructor; 55 | proj_tr_ptr proj_transform_; 56 | }; 57 | -------------------------------------------------------------------------------- /src/mapnik_vector_tile_clear.cpp: -------------------------------------------------------------------------------- 1 | #include "mapnik_vector_tile.hpp" 2 | 3 | namespace { 4 | 5 | struct AsyncClear : Napi::AsyncWorker 6 | { 7 | AsyncClear(mapnik::vector_tile_impl::merc_tile_ptr const& tile, Napi::Function const& callback) 8 | : Napi::AsyncWorker(callback), 9 | tile_(tile) {} 10 | 11 | void Execute() override 12 | { 13 | try 14 | { 15 | tile_->clear(); 16 | } 17 | catch (std::exception const& ex) 18 | { 19 | // No reason this should ever throw an exception, not currently testable. 20 | // LCOV_EXCL_START 21 | SetError(ex.what()); 22 | // LCOV_EXCL_STOP 23 | } 24 | } 25 | 26 | private: 27 | mapnik::vector_tile_impl::merc_tile_ptr tile_; 28 | }; 29 | } // namespace 30 | 31 | /** 32 | * Remove all data from this vector tile (synchronously) 33 | * @name clearSync 34 | * @memberof VectorTile 35 | * @instance 36 | * @example 37 | * vt.clearSync(); 38 | * console.log(vt.getData().length); // 0 39 | */ 40 | Napi::Value VectorTile::clearSync(Napi::CallbackInfo const& info) 41 | { 42 | Napi::Env env = info.Env(); 43 | tile_->clear(); 44 | return env.Undefined(); 45 | } 46 | 47 | /** 48 | * Remove all data from this vector tile 49 | * 50 | * @memberof VectorTile 51 | * @instance 52 | * @name clear 53 | * @param {Function} callback 54 | * @example 55 | * vt.clear(function(err) { 56 | * if (err) throw err; 57 | * console.log(vt.getData().length); // 0 58 | * }); 59 | */ 60 | 61 | Napi::Value VectorTile::clear(Napi::CallbackInfo const& info) 62 | { 63 | if (info.Length() == 0) 64 | { 65 | return clearSync(info); 66 | } 67 | Napi::Env env = info.Env(); 68 | 69 | // ensure callback is a function 70 | Napi::Value callback = info[info.Length() - 1]; 71 | if (!callback.IsFunction()) 72 | { 73 | Napi::TypeError::New(env, "last argument must be a callback function").ThrowAsJavaScriptException(); 74 | return env.Undefined(); 75 | } 76 | auto* worker = new AsyncClear(tile_, callback.As()); 77 | worker->Queue(); 78 | return env.Undefined(); 79 | } 80 | -------------------------------------------------------------------------------- /src/object_to_container.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | static inline void object_to_container(mapnik::attributes& cont, Napi::Object const& vars) 9 | { 10 | Napi::Array names = vars.GetPropertyNames(); 11 | std::size_t length = names.Length(); 12 | mapnik::transcoder tr("utf8"); 13 | cont.reserve(length); 14 | for (std::size_t i = 0; i < length; ++i) 15 | { 16 | std::string name = names.Get(i).ToString(); 17 | Napi::Value value = vars.Get(name); 18 | 19 | if (value.IsBoolean()) 20 | { 21 | cont[name] = value.As().Value(); 22 | } 23 | else if (value.IsString()) 24 | { 25 | cont[name] = tr.transcode(value.As().Utf8Value().c_str()); 26 | } 27 | else if (value.IsNumber()) 28 | { 29 | mapnik::value_double num = value.As().DoubleValue(); 30 | if (num == value.As().Int32Value()) 31 | { 32 | cont[name] = static_cast(num); 33 | } 34 | else 35 | { 36 | cont[name] = num; 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/pixel_utils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace detail { 7 | namespace traits { 8 | 9 | template 10 | struct null_image 11 | { 12 | }; 13 | 14 | template <> 15 | struct null_image 16 | { 17 | using type = mapnik::image_null; 18 | }; 19 | 20 | template <> 21 | struct null_image 22 | { 23 | using type = mapnik::image_view_null; 24 | }; 25 | } // namespace traits 26 | 27 | template // image or image_view 28 | struct visitor_get_pixel 29 | { 30 | using image_null_type = typename traits::null_image::type; 31 | 32 | visitor_get_pixel(Napi::Env env, int x, int y) 33 | : env_(env), x_(x), y_(y) {} 34 | 35 | Napi::Value operator()(image_null_type const&) const 36 | { 37 | // This should never be reached because the width and height of 0 for a null 38 | // image will prevent the visitor from being called. 39 | return env_.Undefined(); 40 | } 41 | 42 | template 43 | Napi::Value operator()(T const& data) const 44 | { 45 | using image_type = T; 46 | using pixel_type = typename image_type::pixel_type; 47 | Napi::EscapableHandleScope scope(env_); 48 | pixel_type val = mapnik::get_pixel(data, x_, y_); 49 | return scope.Escape(Napi::Number::New(env_, val)); 50 | } 51 | 52 | private: 53 | Napi::Env env_; 54 | int x_; 55 | int y_; 56 | }; 57 | 58 | struct visitor_set_pixel 59 | { 60 | visitor_set_pixel(Napi::Number const& num, int x, int y) 61 | : num_(num), x_(x), y_(y) {} 62 | 63 | void operator()(mapnik::image_null&) const 64 | { 65 | // no-op 66 | } 67 | template 68 | void operator()(T& image) const 69 | { 70 | mapnik::set_pixel(image, x_, y_, num_.DoubleValue()); 71 | } 72 | 73 | private: 74 | Napi::Number const& num_; 75 | int x_; 76 | int y_; 77 | }; 78 | } // namespace detail 79 | -------------------------------------------------------------------------------- /src/tint.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | static inline void rgb_to_hsl(std::uint32_t red, 7 | std::uint32_t green, 8 | std::uint32_t blue, 9 | double& h, 10 | double& s, 11 | double& l) 12 | { 13 | double r = red / 255.0; 14 | double g = green / 255.0; 15 | double b = blue / 255.0; 16 | double max = std::max(r, std::max(g, b)); 17 | double min = std::min(r, std::min(g, b)); 18 | double delta = max - min; 19 | double gamma = max + min; 20 | h = 0.0, s = 0.0, l = gamma / 2.0; 21 | if (delta > 0.0) 22 | { 23 | s = l > 0.5 ? delta / (2.0 - gamma) : delta / gamma; 24 | if (r >= b && r > g) h = (g - b) / delta + (g < b ? 6.0 : 0.0); 25 | if (g >= r && g > b) h = (b - r) / delta + 2.0; 26 | if (b >= g && b > r) h = (r - g) / delta + 4.0; 27 | h /= 6.0; 28 | } 29 | } 30 | 31 | static inline double hueToRGB(double m1, double m2, double h) 32 | { 33 | // poor mans fmod 34 | if (h < 0) h += 1; 35 | if (h > 1) h -= 1; 36 | if (h * 6 < 1) return m1 + (m2 - m1) * h * 6; 37 | if (h * 2 < 1) return m2; 38 | if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6; 39 | return m1; 40 | } 41 | 42 | static inline void hsl_to_rgb(double h, 43 | double s, 44 | double l, 45 | std::uint32_t& r, 46 | std::uint32_t& g, 47 | std::uint32_t& b) 48 | { 49 | if (!s) 50 | { 51 | r = g = b = static_cast(std::floor((l * 255.0) + .5)); 52 | } 53 | else 54 | { 55 | double m2 = (l <= 0.5) ? l * (s + 1) : l + s - l * s; 56 | double m1 = l * 2.0 - m2; 57 | r = static_cast(std::floor(hueToRGB(m1, m2, h + 0.33333) * 255.0) + .5); 58 | g = static_cast(std::floor(hueToRGB(m1, m2, h) * 255.0) + .5); 59 | b = static_cast(std::floor(hueToRGB(m1, m2, h - 0.33333) * 255.0) + .5); 60 | } 61 | } 62 | 63 | struct Tinter 64 | { 65 | double h0; 66 | double h1; 67 | double s0; 68 | double s1; 69 | double l0; 70 | double l1; 71 | double a0; 72 | double a1; 73 | 74 | Tinter() : h0(0), 75 | h1(1), 76 | s0(0), 77 | s1(1), 78 | l0(0), 79 | l1(1), 80 | a0(0), 81 | a1(1) {} 82 | 83 | bool is_identity() const 84 | { 85 | return (h0 == 0 && 86 | h1 == 1 && 87 | s0 == 0 && 88 | s1 == 1 && 89 | l0 == 0 && 90 | l1 == 1); 91 | } 92 | 93 | bool is_alpha_identity() const 94 | { 95 | return (a0 == 0 && 96 | a1 == 1); 97 | } 98 | }; 99 | -------------------------------------------------------------------------------- /src/utils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // stl 6 | #include 7 | #include 8 | 9 | // core types 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | namespace node_mapnik { 17 | 18 | using value_integer = mapnik::value_integer; 19 | 20 | // adapted to work for both mapnik features and mapnik parameters 21 | struct value_converter 22 | { 23 | explicit value_converter(Napi::Env env) 24 | : env_(env) {} 25 | 26 | Napi::Value operator()(value_integer val) const 27 | { 28 | return Napi::Number::New(env_, val); 29 | } 30 | 31 | Napi::Value operator()(mapnik::value_bool val) const 32 | { 33 | return Napi::Boolean::New(env_, val); 34 | } 35 | 36 | Napi::Value operator()(double val) const 37 | { 38 | return Napi::Number::New(env_, val); 39 | } 40 | 41 | Napi::Value operator()(std::string const& val) const 42 | { 43 | return Napi::String::New(env_, val.c_str()); 44 | } 45 | 46 | Napi::Value operator()(mapnik::value_unicode_string const& val) const 47 | { 48 | std::string buffer; 49 | mapnik::to_utf8(val, buffer); 50 | return Napi::String::New(env_, buffer.c_str()); 51 | } 52 | 53 | Napi::Value operator()(mapnik::value_null const&) const 54 | { 55 | return env_.Null(); 56 | } 57 | 58 | private: 59 | Napi::Env env_; 60 | }; 61 | 62 | inline void params_to_object(Napi::Env env, Napi::Object& params, std::string const& key, mapnik::value_holder const& val) 63 | { 64 | params.Set(key, mapnik::util::apply_visitor(value_converter(env), val)); 65 | } 66 | } // namespace node_mapnik 67 | -------------------------------------------------------------------------------- /test/blend-fixtures/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/1.png -------------------------------------------------------------------------------- /test/blend-fixtures/1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/1a.png -------------------------------------------------------------------------------- /test/blend-fixtures/1x1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/1x1.png -------------------------------------------------------------------------------- /test/blend-fixtures/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/2.png -------------------------------------------------------------------------------- /test/blend-fixtures/2a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/2a.png -------------------------------------------------------------------------------- /test/blend-fixtures/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/3.png -------------------------------------------------------------------------------- /test/blend-fixtures/corrupt-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/corrupt-1.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-compression-5.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-compression-5.webp -------------------------------------------------------------------------------- /test/blend-fixtures/expected-hex-palette-256-tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-hex-palette-256-tiny.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-hex-palette-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-hex-palette-256.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-matte-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-matte-6.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-matte-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-matte-8.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-object-tint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-object-tint.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-object-x-y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-object-x-y.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-oct-palette-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-oct-palette-256.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-palette-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-palette-256.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected-reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected-reverse.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected.jpg -------------------------------------------------------------------------------- /test/blend-fixtures/expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected.png -------------------------------------------------------------------------------- /test/blend-fixtures/expected.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/blend-fixtures/expected.webp -------------------------------------------------------------------------------- /test/blend-fixtures/not_a_real_image.txt: -------------------------------------------------------------------------------- 1 | stuff 2 | -------------------------------------------------------------------------------- /test/cairo_surface.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | 6 | test('should throw with invalid usage', (assert) => { 7 | // no 'new' keyword 8 | assert.throws(function() { mapnik.CairoSurface(1, 1); }); 9 | 10 | // invalid args 11 | assert.throws(function() { new mapnik.CairoSurface(); }); 12 | assert.throws(function() { new mapnik.CairoSurface(1); }); 13 | assert.throws(function() { new mapnik.CairoSurface('foo'); }); 14 | assert.throws(function() { new mapnik.CairoSurface('a', 'b', 'c'); }); 15 | assert.throws(function() { new mapnik.CairoSurface(1, 'b', 'c'); }); 16 | assert.end(); 17 | }); 18 | 19 | test('should be initialized properly', (assert) => { 20 | var im = new mapnik.CairoSurface('SVG',256, 256); 21 | assert.ok(im instanceof mapnik.CairoSurface); 22 | assert.equal(im.width(), 256); 23 | assert.equal(im.height(), 256); 24 | assert.equal(im.getData(), ''); 25 | assert.end(); 26 | }); 27 | -------------------------------------------------------------------------------- /test/constants.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | var fs = require('fs'); 6 | 7 | test('should have valid settings', (assert) => { 8 | assert.ok(mapnik.settings); 9 | assert.ok(mapnik.settings.paths); 10 | assert.ok(mapnik.settings.paths.fonts.length); 11 | //assert.ok(fs.statSync(mapnik.settings.paths.fonts)); 12 | assert.ok(mapnik.settings.paths.input_plugins.length); 13 | assert.ok(mapnik.settings.paths.mapnik_index.length); 14 | assert.ok(mapnik.settings.paths.shape_index.length); 15 | assert.ok(fs.statSync(mapnik.settings.paths.input_plugins)); 16 | 17 | /* has version info */ 18 | assert.ok(mapnik.versions); 19 | //assert.ok(mapnik.versions.node); 20 | //assert.ok(mapnik.versions.v8); 21 | assert.ok(mapnik.versions.mapnik); 22 | assert.ok(mapnik.versions.mapnik_number); 23 | assert.ok(mapnik.versions.boost); 24 | assert.ok(mapnik.versions.boost_number); 25 | 26 | assert.ok(mapnik.Geometry.Point, 1); 27 | assert.ok(mapnik.Geometry.LineString, 2); 28 | assert.ok(mapnik.Geometry.Polygon, 3); 29 | assert.end(); 30 | }); 31 | 32 | test('should have valid version info', (assert) => { 33 | /* has version info */ 34 | assert.ok(mapnik.versions); 35 | //assert.ok(mapnik.versions.node); 36 | //assert.ok(mapnik.versions.v8); 37 | assert.ok(mapnik.versions.mapnik); 38 | assert.ok(mapnik.versions.mapnik_number); 39 | assert.ok(mapnik.versions.boost); 40 | assert.ok(mapnik.versions.boost_number); 41 | 42 | assert.ok(mapnik.Geometry.Point, 1); 43 | assert.ok(mapnik.Geometry.LineString, 2); 44 | assert.ok(mapnik.Geometry.Polygon, 3); 45 | assert.end(); 46 | }); 47 | 48 | test('should expose Geometry enums', (assert) => { 49 | assert.ok(mapnik.Geometry.Point, 1); 50 | assert.ok(mapnik.Geometry.LineString, 2); 51 | assert.ok(mapnik.Geometry.Polygon, 3); 52 | assert.end(); 53 | }); 54 | -------------------------------------------------------------------------------- /test/data/NZ_Coastline_NZMG.dbf: -------------------------------------------------------------------------------- 1 | _ascalerankN 2 | featureclaC 0Coastline 0Coastline -------------------------------------------------------------------------------- /test/data/NZ_Coastline_NZMG.prj: -------------------------------------------------------------------------------- 1 | PROJCS["NZGD49_New_Zealand_Map_Grid",GEOGCS["GCS_New_Zealand_1949",DATUM["D_New_Zealand_1949",SPHEROID["International_1924",6378388,297]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["New_Zealand_Map_Grid"],PARAMETER["latitude_of_origin",-41],PARAMETER["Longitude_Of_Origin",173],PARAMETER["false_easting",2510000],PARAMETER["false_northing",6023150],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/NZ_Coastline_NZMG.qpj: -------------------------------------------------------------------------------- 1 | PROJCS["NZGD49 / New Zealand Map Grid",GEOGCS["NZGD49",DATUM["New_Zealand_Geodetic_Datum_1949",SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","7022"]],TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],AUTHORITY["EPSG","6272"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4272"]],PROJECTION["New_Zealand_Map_Grid"],PARAMETER["latitude_of_origin",-41],PARAMETER["central_meridian",173],PARAMETER["false_easting",2510000],PARAMETER["false_northing",6023150],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","27200"]] 2 | -------------------------------------------------------------------------------- /test/data/NZ_Coastline_NZMG.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/NZ_Coastline_NZMG.shp -------------------------------------------------------------------------------- /test/data/NZ_Coastline_NZMG.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/NZ_Coastline_NZMG.shx -------------------------------------------------------------------------------- /test/data/avlee-区县级行政区划.csv: -------------------------------------------------------------------------------- 1 | x,y,bigint 2 | 0,0,2147483648 3 | 0,0,9223372036854775807 4 | -------------------------------------------------------------------------------- /test/data/dir-区县级行政区划/points.csv: -------------------------------------------------------------------------------- 1 | x,y,bigint 2 | 0,0,2147483648 3 | 0,0,9223372036854775807 4 | -------------------------------------------------------------------------------- /test/data/dir-区县级行政区划/你好-ellipses.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /test/data/dir-区县级行政区划/你好_DejaVuSansMono-BoldOblique.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/dir-区县级行政区划/你好_DejaVuSansMono-BoldOblique.ttf -------------------------------------------------------------------------------- /test/data/images/10x10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/10x10.jpeg -------------------------------------------------------------------------------- /test/data/images/10x10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/10x10.png -------------------------------------------------------------------------------- /test/data/images/10x10.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/10x10.tiff -------------------------------------------------------------------------------- /test/data/images/10x10.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/10x10.webp -------------------------------------------------------------------------------- /test/data/images/14_2788_6533.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/14_2788_6533.webp -------------------------------------------------------------------------------- /test/data/images/corrupt-10x10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/corrupt-10x10.png -------------------------------------------------------------------------------- /test/data/images/large_overzoom.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/large_overzoom.expected.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-bessel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-bessel.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-bicubic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-bicubic.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-bilinear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-bilinear.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-blackman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-blackman.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-catrom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-catrom.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-gaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-gaussian.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-hamming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-hamming.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-hanning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-hanning.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-hermite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-hermite.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-kaiser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-kaiser.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-lanczos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-lanczos.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-mitchell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-mitchell.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-near.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-near.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-near.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-near.tif -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-offset.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-offset.tif -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-quadric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-quadric.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-sinc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-sinc.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-spline16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-spline16.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-100x100-spline36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-100x100-spline36.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-bessel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-bessel.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-bicubic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-bicubic.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-bilinear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-bilinear.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-blackman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-blackman.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-catrom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-catrom.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-gaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-gaussian.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-hamming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-hamming.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-hanning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-hanning.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-hermite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-hermite.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-kaiser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-kaiser.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-lanczos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-lanczos.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-mitchell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-mitchell.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-multiple_offset.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-multiple_offset.tif -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-near.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-near.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-near.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-near.tif -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-offset.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-offset.tif -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-offset_wh.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-offset_wh.tif -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-quadric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-quadric.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-sinc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-sinc.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-spline16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-spline16.png -------------------------------------------------------------------------------- /test/data/images/sat_image-expected-50x50-spline36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image-expected-50x50-spline36.png -------------------------------------------------------------------------------- /test/data/images/sat_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image.png -------------------------------------------------------------------------------- /test/data/images/sat_image.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image.tif -------------------------------------------------------------------------------- /test/data/images/sat_image2-expected-offset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image2-expected-offset.png -------------------------------------------------------------------------------- /test/data/images/sat_image2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/images/sat_image2.jpg -------------------------------------------------------------------------------- /test/data/large_overzoom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -180,-85.0511,180,85.0511 5 | 0,0,3 6 | png8:m=h 7 | 22 8 | 0 9 | 1 10 | 11 | 27 | 33 | 34 | _image 35 | _image-raster 36 | 37 | 38 | _image 39 | 40 | 41 | -------------------------------------------------------------------------------- /test/data/map-a/DejaVuSerifCondensed-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/map-a/DejaVuSerifCondensed-BoldItalic.ttf -------------------------------------------------------------------------------- /test/data/map-b/DejaVuSerifCondensed-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/map-b/DejaVuSerifCondensed-Bold.ttf -------------------------------------------------------------------------------- /test/data/map.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 21 | 22 | 23 | world 24 | 25 | ./world_merc.shp 26 | iso-8859-1 27 | shape 28 | 29 | 30 | 31 | 32 | nz 33 | 34 | ./NZ_Coastline_NZMG.shp 35 | shape 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /test/data/markers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 16 | 17 | 18 | style 19 | label 20 | 21 | world_merc.shp 22 | iso-8859-1 23 | shape 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /test/data/parse.error.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "features": [ 4 | { 5 | "oofda" 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /test/data/postgis-create-db-and-tables.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE test(gid serial PRIMARY KEY, geom geometry, colbigint bigint, col_text text, "col-char" char, "col+bool" boolean, "colnumeric" numeric, "colsmallint" smallint, "colfloat4" real, "colfloat8" double precision, "colcharacter" character); 2 | INSERT INTO test VALUES (DEFAULT, GeomFromEWKT('SRID=4326;POINT(0 0)'), -9223372036854775808, 'I am a point', 'A', TRUE, 1234567809990001, 0, 0.0, 0.0, 'A'); 3 | INSERT INTO test VALUES (DEFAULT, GeomFromEWKT('SRID=4326;POINT(-2 2)'), 9223372036854775807, 'I, too, am a point!', 'B', FALSE, -123456780999001, 0, 0.0, 0.0, 'A'); 4 | INSERT INTO test VALUES (DEFAULT, GeomFromEWKT('SRID=4326;MULTIPOINT(2 1,1 2)'), -1, 'I`m even a MULTI Point', 'Z', FALSE, 12345678099901, 0, 0.0, 0.0, 'A'); 5 | INSERT INTO test VALUES (DEFAULT, GeomFromEWKT('SRID=4326;LINESTRING(0 0,1 1,1 2)'), 0, 'This is a line string', 'ß', FALSE, -9, 0, 0.0, 0.0, 'A'); 6 | INSERT INTO test VALUES (DEFAULT, GeomFromEWKT('SRID=4326;MULTILINESTRING((1 0,0 1,3 2),(3 2,5 4))'), 1, 'multi line string', 'Ü', TRUE, 0.00001, 0, 0.0, 0.0, 'A'); 7 | INSERT INTO test VALUES (DEFAULT, GeomFromEWKT('SRID=4326;POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1))'), 1, 'polygon', 'Ü', TRUE, 0.00001, 0, 0.0, 0.0, 'A'); 8 | INSERT INTO test VALUES (DEFAULT, GeomFromEWKT('SRID=4326;MULTIPOLYGON(((1 1,3 1,3 3,1 3,1 1),(1 1,2 1,2 2,1 2,1 1)), ((-1 -1,-1 -2,-2 -2,-2 -1,-1 -1)))'), 5432, 'multi ploygon', 'X', TRUE, 999, 0, 0.0, 0.0, 'A'); 9 | INSERT INTO test VALUES (DEFAULT, GeomFromEWKT('SRID=4326;GEOMETRYCOLLECTION(POLYGON((1 1, 2 1, 2 2, 1 2,1 1)),POINT(2 3),LINESTRING(2 3,3 4))'), 8080, 'GEOMETRYCOLLECTION', 'm', TRUE, 9999, 0, 0.0, 0.0, 'A'); 10 | -------------------------------------------------------------------------------- /test/data/postgis_datasource_tokens_query.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | postgis 6 | localhost 7 | node-mapnik-tmp-postgis-test-db 8 | 4326 9 | geom 10 | 11 | (SELECT gid, geom FROM test WHERE gid = !@fieldid!) as field_shapes 12 | 13 | false 14 | -150,-85,150,85 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/data/sat_map.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | style 9 | 10 | ./images/sat_image.png 11 | gdal 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/data/ünicode_symbols.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | csv 14 | 15 | x,y 16 | 1,1 17 | 4,1 18 | 1,4 19 | 4,4 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | 34 | frame 35 | 36 | csv 37 | 38 | x,y 39 | 0,0 40 | 5,0 41 | 0,5 42 | 5,5 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /test/data/v4-10_131_242.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/v4-10_131_242.mvt -------------------------------------------------------------------------------- /test/data/v6-0_0_0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/v6-0_0_0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/10.196.370.vector.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/10.196.370.vector.pbf -------------------------------------------------------------------------------- /test/data/vector_tile/12.771.1608.vector.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/12.771.1608.vector.pbf -------------------------------------------------------------------------------- /test/data/vector_tile/13-2411-3080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/13-2411-3080.png -------------------------------------------------------------------------------- /test/data/vector_tile/13.1337.2825.vector.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/13.1337.2825.vector.pbf -------------------------------------------------------------------------------- /test/data/vector_tile/3.2.3.mbs4.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/3.2.3.mbs4.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/6.20.34.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/6.20.34.pbf -------------------------------------------------------------------------------- /test/data/vector_tile/cloudless_1_0_0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/cloudless_1_0_0.jpg -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/25084.vector.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/25084.vector.pbf -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/25084_2.vector.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/25084_2.vector.pbf -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/badtile.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/badtile.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/0-0-0-mosaic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/0-0-0-mosaic.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/2-1-1-empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/2-1-1-empty.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/2-1-1-no-point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/2-1-1-no-point.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/2-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/2-1-1.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/2-1-1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/2-1-1b.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/concat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/concat.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/image_concat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/image_concat.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/world-reencode-max-extent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/world-reencode-max-extent.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/expected/world-reencode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/expected/world-reencode.png -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/layers/lines.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | lines 11 | 12 | csv 13 | 14 | wkt 15 | "LINESTRING(-180 60, 180 -60)" 16 | "LINESTRING(-180 -60, 180 60)" 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/layers/points.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | points 11 | 12 | csv 13 | 14 | x,y 15 | 0,0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/styles/all.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | raster 10 | 11 | 12 | 13 | raster 14 | 15 | 16 | 25 | 26 | 27 | lines 28 | 29 | 30 | lines 31 | 32 | 33 | lines 34 | 35 | 36 | lines 37 | 38 | 39 | lines 40 | 41 | 42 | lines 43 | 44 | 45 | lines 46 | 47 | 48 | lines 49 | 50 | 51 | lines 52 | 53 | 54 | 59 | 60 | 61 | points 62 | 63 | 64 | points 65 | 66 | 67 | points 68 | 69 | 70 | points 71 | 72 | 73 | points 74 | 75 | 76 | points 77 | 78 | 79 | points 80 | 81 | 82 | points 83 | 84 | 85 | points 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/lines-0-0-0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/lines-0-0-0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/lines-1-0-0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/lines-1-0-0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/lines-1-0-1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/lines-1-0-1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/lines-1-1-0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/lines-1-1-0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/lines-1-1-1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/lines-1-1-1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/lines-2-0-0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/lines-2-0-0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/lines-2-0-1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/lines-2-0-1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/lines-2-1-1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/lines-2-1-1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/points-0-0-0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/points-0-0-0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/points-1-0-0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/points-1-0-0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/points-1-0-1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/points-1-0-1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/points-1-1-0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/points-1-1-0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/points-1-1-1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/points-1-1-1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/points-2-0-0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/points-2-0-0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/points-2-0-1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/points-2-0-1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/compositing/tiles/points-2-1-1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/compositing/tiles/points-2-1-1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/errors.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /test/data/vector_tile/generic_map.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | %s 20 | 21 | -------------------------------------------------------------------------------- /test/data/vector_tile/invalid_v2_tile.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/invalid_v2_tile.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/invalid_v2_tile_bad_geom.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/invalid_v2_tile_bad_geom.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/layers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | style 6 | 7 | ../../data/world_merc.shp 8 | iso-8859-1 9 | shape 10 | 11 | 12 | 13 | 14 | style 15 | 16 | ../../data/world_merc.shp 17 | iso-8859-1 18 | shape 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/data/vector_tile/natural_earth.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/natural_earth.tif -------------------------------------------------------------------------------- /test/data/vector_tile/nz-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/nz-1.png -------------------------------------------------------------------------------- /test/data/vector_tile/nz-1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/nz-1b.png -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted1.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted1.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted1.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted1.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted1.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Mercator_2SP",GEOGCS["GCS_WGS_1984",DATUM["D_unknown",SPHEROID["WGS84",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted1.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted1.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted1.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted1.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted1.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted10.dbf: -------------------------------------------------------------------------------- 1 | _A FIDN 0 -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted10.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted10.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted10.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted10.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted10.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted10.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted10.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted10.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted11.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted11.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted11.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted11.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted11.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted11.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted11.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted11.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted11.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted11.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted12.geojson: -------------------------------------------------------------------------------- 1 | {"type":"FeatureCollection","name":"hillshade","features":[{"type":"Feature","id":6,"geometry":{"type":"Polygon","coordinates":[[[33.8356590270996,-12.7456745355298],[33.8358306884766,-12.7448373768196],[33.8353157043457,-12.7448373768196],[33.8351440429688,-12.7451722406357],[33.8351440429688,-12.7466791223298],[33.8351440429688,-12.7468465530757],[33.8353157043457,-12.747013983711],[33.8353157043457,-12.7475162749527],[33.8351440429688,-12.7474744173873],[33.8351440429688,-12.7480604226737],[33.8358306884766,-12.7480185651982],[33.8354873657227,-12.7468465530757],[33.8356590270996,-12.7466791223298],[33.8365173339844,-12.7458419669398],[33.8365173339844,-12.7453396723777],[33.8356590270996,-12.7456745355298]],[[33.8351440429688,-12.7466791223298],[33.8354873657227,-12.7460093982392],[33.8356590270996,-12.7466791223298],[33.8351440429688,-12.7466791223298]]]},"properties":{"class":"highlight","level":90}} 2 | ]} -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted12.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted12.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted12.geojson 14 | geojson 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted13.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted13.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted13.geojson 14 | geojson 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted14.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted14.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted14.geojson 14 | geojson 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted15.dbf: -------------------------------------------------------------------------------- 1 | _A FIDN 0 -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted15.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted15.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted15.prj: -------------------------------------------------------------------------------- 1 | PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted15.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted15.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted15.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted15.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted15.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted16.dbf: -------------------------------------------------------------------------------- 1 | _A FIDN 0 -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted16.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted16.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted16.prj: -------------------------------------------------------------------------------- 1 | PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted16.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted16.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted16.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted16.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted16.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted17.geojson: -------------------------------------------------------------------------------- 1 | {"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[33.9738035128529,-13.3567610310678],[33.974018089574,-13.3567610310678],[33.9743184969837,-13.3569280490312],[33.9744901583606,-13.3573038390263],[33.9743184969837,-13.3573038390263],[33.973631851476,-13.3573038390263],[33.973460190099,-13.3575126109929],[33.9735460207875,-13.3578466457638],[33.9727735445913,-13.3577631371144],[33.9731168673452,-13.3572620846113],[33.9732885287221,-13.357136821323],[33.9735460207875,-13.3570950668791],[33.973631851476,-13.3568862945512],[33.9738035128529,-13.3567610310678]],[[33.9743184969837,-13.3573038390263],[33.9743184969837,-13.357136821323],[33.9741039202625,-13.3569280490312],[33.9739751742298,-13.3569280490312],[33.9739751742298,-13.3570950668791],[33.9741468356067,-13.3572620846113],[33.9743184969837,-13.3573038390263]]]}}]} 2 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted17.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted17.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted17.geojson 14 | geojson 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted18.dbf: -------------------------------------------------------------------------------- 1 | _A FIDN 0 -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted18.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted18.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted18.prj: -------------------------------------------------------------------------------- 1 | PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted18.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted18.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted18.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted18.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted18.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted19.dbf: -------------------------------------------------------------------------------- 1 | _A FIDN 0 -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted19.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted19.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted19.prj: -------------------------------------------------------------------------------- 1 | PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted19.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted19.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted19.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted19.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted19.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted2.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted2.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted2.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted2.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted2.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Mercator_2SP",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted2.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted2.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted2.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted2.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted2.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted20.dbf: -------------------------------------------------------------------------------- 1 | _A FIDN 0 -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted20.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted20.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted20.prj: -------------------------------------------------------------------------------- 1 | PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted20.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted20.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted20.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted20.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted20.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted20.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted21.dbf: -------------------------------------------------------------------------------- 1 | _A FIDN 0 -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted21.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted21.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted21.prj: -------------------------------------------------------------------------------- 1 | PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted21.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted21.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted21.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted21.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted21.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted21.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted22.dbf: -------------------------------------------------------------------------------- 1 | _A FIDN 0 -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted22.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted22.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted22.prj: -------------------------------------------------------------------------------- 1 | PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted22.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted22.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted22.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted22.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted22.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted22.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted23.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted23.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted23.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted23.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted23.prj: -------------------------------------------------------------------------------- 1 | PROJCS["WGS_84_Pseudo_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],PARAMETER["standard_parallel_1",0.0]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted23.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted23.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted23.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted23.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted23.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted3.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted3.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted3.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted3.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted3.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Mercator_2SP",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted3.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted3.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted3.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted3.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted3.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted4.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted4.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted4.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted4.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted4.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Mercator_2SP",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted4.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted4.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted4.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted4.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted4.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted5.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted5.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted5.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted5.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted5.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Mercator_2SP",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted5.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted5.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted5.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted5.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted5.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted6.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted6.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted6.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted6.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted6.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Mercator_2SP",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted6.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted6.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted6.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted6.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted6.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted7.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted7.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted7.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted7.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted7.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Mercator_2SP",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted7.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted7.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted7.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted7.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted7.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted8.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted8.dbf -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted8.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted8.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted8.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Mercator_2SP",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted8.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted8.shp -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted8.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted8.shx -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | pasted8.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted9_tile0_0_0_0.mvt.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted9_tile0_0_0_0.mvt.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/pasted/pasted9_tile1_0_0_0.mvt.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/pasted/pasted9_tile1_0_0_0.mvt.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/raster_layer.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | style 9 | 10 | ./natural_earth.tif 11 | gdal 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/data/vector_tile/raster_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 13 | style 14 | style2 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/data/vector_tile/tile-raster.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile-raster.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile-raster2.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile-raster2.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile-raster3.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile-raster3.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile-raster4.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile-raster4.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile-raster5.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile-raster5.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-area_threshold.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-area_threshold.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-b.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-b.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-c.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-c.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-evenOdd.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-evenOdd.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-mpu-false.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-mpu-false.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-mpu-true.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-mpu-true.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-nonZero.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-nonZero.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-process-all-mp-rings.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-process-all-mp-rings.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-simple_and_distance.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-simple_and_distance.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-simple_and_distance.nosse.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-simple_and_distance.nosse.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-simplify_distance.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-simplify_distance.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-simplify_distance.nosse.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-simplify_distance.nosse.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-strictly_simple.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-strictly_simple.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0-strictly_simple_false.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0-strictly_simple_false.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile0.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile0.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile0.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile1.vector.pbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile1.vector.pbf -------------------------------------------------------------------------------- /test/data/vector_tile/tile1.vector.pbf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile1.vector.pbf.gz -------------------------------------------------------------------------------- /test/data/vector_tile/tile2.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile2.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile3.expected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile3.expected.png -------------------------------------------------------------------------------- /test/data/vector_tile/tile3.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile3.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile_threading_async.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile_threading_async.mvt -------------------------------------------------------------------------------- /test/data/vector_tile/tile_threading_auto.mvt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/vector_tile/tile_threading_auto.mvt -------------------------------------------------------------------------------- /test/data/world_merc.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/world_merc.dbf -------------------------------------------------------------------------------- /test/data/world_merc.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/world_merc.json -------------------------------------------------------------------------------- /test/data/world_merc.prj: -------------------------------------------------------------------------------- 1 | PROJCS["Google Maps Global Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]] -------------------------------------------------------------------------------- /test/data/world_merc.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/world_merc.shp -------------------------------------------------------------------------------- /test/data/world_merc.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/world_merc.shx -------------------------------------------------------------------------------- /test/data/ünicode_symbols.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | csv 14 | 15 | x,y 16 | 1,1 17 | 4,1 18 | 1,4 19 | 4,4 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | 34 | frame 35 | 36 | csv 37 | 38 | x,y 39 | 0,0 40 | 5,0 41 | 0,5 42 | 5,5 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /test/data/你好_points.csv: -------------------------------------------------------------------------------- 1 | x,y,bigint 2 | 0,0,2147483648 3 | 0,0,9223372036854775807 4 | -------------------------------------------------------------------------------- /test/data/你好_points.dbf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/你好_points.dbf -------------------------------------------------------------------------------- /test/data/你好_points.geojson: -------------------------------------------------------------------------------- 1 | { "type": "FeatureCollection", 2 | "features": [ 3 | { "type": "Feature", 4 | "geometry": {"type": "Point", "coordinates": [0,0]}, 5 | "properties": {"bigint": 9223372036854775807} 6 | } 7 | ] 8 | } -------------------------------------------------------------------------------- /test/data/你好_points.prj: -------------------------------------------------------------------------------- 1 | GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]] -------------------------------------------------------------------------------- /test/data/你好_points.shp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/你好_points.shp -------------------------------------------------------------------------------- /test/data/你好_points.shx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/你好_points.shx -------------------------------------------------------------------------------- /test/data/你好_points.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/data/你好_points.sqlite -------------------------------------------------------------------------------- /test/expression.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | 6 | 7 | test('should throw with invalid usage', (assert) => { 8 | // no 'new' keyword 9 | assert.throws(function() { mapnik.Expression(); }); 10 | // invalid args 11 | assert.throws(function() { new mapnik.Expression(); }); 12 | assert.throws(function() { new mapnik.Expression(1); }); 13 | assert.throws(function() { new mapnik.Expression('[asdfadsa]]'); }); 14 | assert.end(); 15 | }); 16 | 17 | test('should accept complex expressions', (assert) => { 18 | // valid expression strings 19 | var expr = new mapnik.Expression('[ATTR]'); 20 | expr = new mapnik.Expression('[ATTR]+2'); 21 | expr = new mapnik.Expression('[ATTR]/2'); 22 | 23 | expr = new mapnik.Expression('[ATTR1]/[ATTR2]'); 24 | assert.equal(expr.toString(), '[ATTR1]/[ATTR2]'); 25 | 26 | expr = new mapnik.Expression('\'literal\''); 27 | assert.equal(expr.toString(), "'literal'"); 28 | assert.end(); 29 | }); 30 | 31 | test('should support evaluation to js types', (assert) => { 32 | var expr = new mapnik.Expression("[attr]='value'"); 33 | var feature = new mapnik.Feature.fromJSON('{"type":"Feature","properties":{"attr":"value"},"geometry":null}'); 34 | 35 | // Test bad parameters 36 | assert.throws(function() { expr.evaluate(); }); 37 | assert.throws(function() { expr.evaluate(null); }); 38 | assert.throws(function() { expr.evaluate(feature, null); }); 39 | assert.throws(function() { expr.evaluate(feature, {variables:null}); }); 40 | 41 | assert.equal(expr.evaluate(feature), true); 42 | assert.equal(expr.evaluate(feature).toString(), 'true'); 43 | assert.end(); 44 | }); 45 | 46 | test('should support evaluation with variables', (assert) => { 47 | var expr = new mapnik.Expression("[integer]=@integer and [bool]=@bool and [string]=@string and [double]=@double"); 48 | var options = {variables: { 'integer': 22, 'bool': true, 'string': "string", 'double': 1.0001 } }; 49 | var feature = new mapnik.Feature.fromJSON('{"type":"Feature","properties":{"integer":22, "bool": 1, "string": "string", "double":1.0001},"geometry":null}'); 50 | assert.equal(expr.evaluate(feature, options), true); 51 | assert.equal(expr.evaluate(feature, options).toString(), 'true'); 52 | assert.end(); 53 | }); 54 | -------------------------------------------------------------------------------- /test/font_path.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var path = require('path'); 5 | 6 | var separator = (process.platform === 'win32') ? ';' : ':'; 7 | 8 | test('should auto-register paths in MAPNIK_FONT_PATH', (assert) => { 9 | process.env.MAPNIK_FONT_PATH = [path.join(__dirname, 'data', 'dir-区县级行政区划'), 10 | '/System/Library/Fonts/'] 11 | .join(separator); 12 | 13 | // ensure the module is reloaded so that the newly set 14 | // process.env.MAPNIK_FONT_PATH takes effect 15 | delete require.cache[require.resolve('../')]; 16 | var mapnik = require('../'); 17 | 18 | assert.ok(mapnik.fonts().indexOf('DejaVu Sans Mono Bold Oblique') >= 0); 19 | assert.end(); 20 | }); 21 | -------------------------------------------------------------------------------- /test/geotiff-load.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | 4 | var test = require('tape'); 5 | var mapnik = require('../'); 6 | var path = require('path'); 7 | 8 | // puts unnatural, odd, and intentionally racey load on opening geotiff 9 | 10 | test('should be able to open geotiff various ways without crashing', (assert) => { 11 | assert.plan(5) 12 | mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'gdal.input')); 13 | var vtile = new mapnik.VectorTile(0, 0, 0); 14 | var map = new mapnik.Map(256, 256); 15 | map.load('./test/data/vector_tile/raster_layer.xml',{},function(err,_map) { if (err) throw err; assert.ok(_map); }); 16 | map.render(vtile,{},function(err,vtile) { 17 | if (err) throw err; 18 | assert.ok(vtile); 19 | }); 20 | var map2 = new mapnik.Map(256, 256); 21 | map2.load('./test/data/vector_tile/raster_layer.xml',{},function(err,_map) { if (err) throw err; assert.ok(_map); }); 22 | var map3 = new mapnik.Map(256, 256); 23 | map3.load('./test/data/vector_tile/raster_layer.xml',{},function(err,_map) { if (err) throw err; assert.ok(_map); }); 24 | map3.render(vtile,{},function(err,vtile) { 25 | if (err) throw err; 26 | assert.ok(vtile); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /test/image.filter.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | 6 | test('should throw with invalid usage', (assert) => { 7 | var im = new mapnik.Image(3,3); 8 | assert.throws(function() { im.filter(); }); 9 | assert.throws(function() { im.filterSync(); }); 10 | assert.throws(function() { im.filter(null); }); 11 | assert.throws(function() { im.filterSync(null); }); 12 | assert.throws(function() { im.filter(null, function(err,im) {}); }); 13 | assert.throws(function() { im.filter('blur', null); }); 14 | assert.throws(function() { im.filterSync('notrealfilter'); }); 15 | assert.throws(function() { im.filter('notrealfilter'); }); 16 | im.filter('notrealfilter', function(err,im) { 17 | assert.throws(function() { if (err) throw err; }); 18 | assert.end(); 19 | }); 20 | }); 21 | 22 | test('should blur image - sync', (assert) => { 23 | var im = new mapnik.Image(3,3); 24 | im.fill(new mapnik.Color('blue')); 25 | im.setPixel(1,1,new mapnik.Color('red')); 26 | im.filterSync('blur'); 27 | assert.equal(im.getPixel(0,0), 4291166264); 28 | assert.equal(im.getPixel(0,1), 4293001244); 29 | assert.equal(im.getPixel(0,2), 4291166264); 30 | assert.equal(im.getPixel(1,0), 4291166264); 31 | assert.equal(im.getPixel(1,1), 4293001244); 32 | assert.equal(im.getPixel(1,2), 4291166264); 33 | assert.equal(im.getPixel(2,0), 4291166264); 34 | assert.equal(im.getPixel(2,1), 4293001244); 35 | assert.equal(im.getPixel(2,2), 4291166264); 36 | assert.end(); 37 | }); 38 | 39 | test('should blur image - async', (assert) => { 40 | var im = new mapnik.Image(3,3); 41 | im.fill(new mapnik.Color('blue')); 42 | im.setPixel(1,1,new mapnik.Color('red')); 43 | im.filter('blur', function(err,im) { 44 | assert.equal(im.getPixel(0,0), 4291166264); 45 | assert.equal(im.getPixel(0,1), 4293001244); 46 | assert.equal(im.getPixel(0,2), 4291166264); 47 | assert.equal(im.getPixel(1,0), 4291166264); 48 | assert.equal(im.getPixel(1,1), 4293001244); 49 | assert.equal(im.getPixel(1,2), 4291166264); 50 | assert.equal(im.getPixel(2,0), 4291166264); 51 | assert.equal(im.getPixel(2,1), 4293001244); 52 | assert.equal(im.getPixel(2,2), 4291166264); 53 | assert.end(); 54 | }); 55 | }); 56 | -------------------------------------------------------------------------------- /test/layers.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | var path = require('path'); 6 | 7 | test('should throw with invalid usage', (assert) => { 8 | // no 'new' keyword 9 | assert.throws(function() { mapnik.Layer('foo'); }); 10 | // invalid args 11 | assert.throws(function() { new mapnik.Layer(); }); 12 | assert.throws(function() { new mapnik.Layer('foo', null); }); 13 | assert.throws(function() { new mapnik.Layer(1); }); 14 | assert.throws(function() { new mapnik.Layer('a', 'b', 'c'); }); 15 | assert.throws(function() { new mapnik.Layer(new mapnik.Layer('foo')); }); 16 | assert.end(); 17 | }); 18 | 19 | test('should initialize properly', (assert) => { 20 | mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'shape.input')); 21 | var layer = new mapnik.Layer('foo', 'epsg:4326'); 22 | assert.equal(layer.name, 'foo'); 23 | layer.active = true; 24 | assert.equal(layer.active, true); 25 | layer.queryable = false; 26 | assert.equal(layer.queryable, false); 27 | layer.clear_label_cache = false; 28 | assert.equal(layer.clear_label_cache, false); 29 | layer.minimum_scale_denominator = 1; 30 | assert.equal(layer.minimum_scale_denominator, 1); 31 | layer.maximum_scale_denominator = 50; 32 | assert.equal(layer.maximum_scale_denominator, 50); 33 | assert.throws(function() { layer.name = null; }); 34 | assert.throws(function() { layer.srs = null; }); 35 | assert.throws(function() { layer.styles = null; }); 36 | assert.throws(function() { layer.datasource = null; }); 37 | assert.throws(function() { layer.datasource = {}; }); 38 | assert.throws(function() { layer.active = null; }); 39 | assert.throws(function() { layer.minimum_scale_denominator = null; }); 40 | assert.throws(function() { layer.maximum_scale_denominator = null; }); 41 | assert.throws(function() { layer.queryable = null; }); 42 | assert.throws(function() { layer.clear_label_cache = null; }); 43 | assert.equal(layer.srs, 'epsg:4326'); 44 | assert.deepEqual(layer.styles, []); 45 | // will be empty/undefined 46 | assert.ok(!layer.datasource); 47 | var options = { 48 | type: 'shape', 49 | file: './test/data/world_merc.shp' 50 | }; 51 | 52 | var ds = new mapnik.Datasource(options); 53 | layer.datasource = ds; 54 | //assert.ok(layer.datasource instanceof mapnik.Datasource); 55 | 56 | // json representation 57 | var meta = layer.describe(); 58 | assert.equal(meta.minimum_scale_denominator, 1); 59 | assert.equal(meta.maximum_scale_denominator, 50); 60 | assert.equal(meta.active, true); 61 | assert.equal(meta.queryable, false); 62 | assert.equal(meta.clear_label_cache, false); 63 | assert.equal(meta.name, 'foo'); 64 | assert.equal(meta.srs, 'epsg:4326'); 65 | assert.deepEqual(meta.styles, []); 66 | assert.deepEqual(meta.datasource, options); 67 | assert.end(); 68 | }); 69 | -------------------------------------------------------------------------------- /test/logger.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | 6 | 7 | test('get_severity should return default', (assert) => { 8 | assert.equal(mapnik.Logger.getSeverity(), mapnik.Logger.ERROR); 9 | assert.end(); 10 | }); 11 | 12 | test('test that you cant initialize a logger', (assert) => { 13 | assert.throws(function() { var l = new mapnik.Logger(); }); 14 | assert.end(); 15 | }); 16 | 17 | test('set_severity should fail with bad input', (assert) => { 18 | assert.throws(function() { mapnik.Logger.setSeverity(); }); 19 | assert.throws(function() { mapnik.Logger.setSeverity(null); }); 20 | assert.throws(function() { mapnik.Logger.setSeverity(2,3); }); 21 | assert.end(); 22 | }); 23 | 24 | test('set_severity should set mapnik.logger', (assert) => { 25 | var orig_severity = mapnik.Logger.getSeverity(); 26 | mapnik.Logger.setSeverity(mapnik.Logger.NONE); 27 | assert.equal(mapnik.Logger.getSeverity(), mapnik.Logger.NONE); 28 | mapnik.Logger.setSeverity(orig_severity); 29 | assert.end(); 30 | }); 31 | -------------------------------------------------------------------------------- /test/map_generation.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | var path = require('path'); 6 | var exists = require('fs').existsSync || require('path').existsSync; 7 | 8 | mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'shape.input')); 9 | 10 | 11 | test('should render async (blank)', (assert) => { 12 | var map = new mapnik.Map(600, 400); 13 | assert.ok(map instanceof mapnik.Map); 14 | map.extent = map.extent; 15 | var im = new mapnik.Image(map.width, map.height); 16 | map.render(im, {scale: 1, buffer_size: 1}, function(err, image) { 17 | assert.ok(image); 18 | assert.ok(!err); 19 | var buffer = im.encodeSync('png'); 20 | assert.ok(buffer); 21 | assert.end(); 22 | }); 23 | }); 24 | 25 | test('should render async (real data)', (assert) => { 26 | var filename = './test/tmp/renderFile2.png'; 27 | var map = new mapnik.Map(600, 400); 28 | map.loadSync('./test/stylesheet.xml'); 29 | map.zoomAll(); 30 | map.renderFile(filename, function(error) { 31 | assert.ok(!error); 32 | assert.ok(exists(filename)); 33 | assert.end(); 34 | }); 35 | }); 36 | 37 | test('should render async to file (png)', (assert) => { 38 | var filename = './test/tmp/renderFile2.png'; 39 | var map = new mapnik.Map(600, 400); 40 | map.loadSync('./test/stylesheet.xml'); 41 | map.zoomAll(); 42 | map.renderFile(filename, function(error) { 43 | assert.ok(!error); 44 | assert.ok(exists(filename)); 45 | assert.end(); 46 | }); 47 | }); 48 | 49 | test('should render async to file (cairo format)', (assert) => { 50 | if (mapnik.supports.cairo) { 51 | var filename = './test/tmp/renderFile2.pdf'; 52 | var map = new mapnik.Map(600, 400); 53 | map.loadSync('./test/stylesheet.xml'); 54 | map.zoomAll(); 55 | map.renderFile(filename, { format: 'pdf' }, function(error) { 56 | assert.ok(!error); 57 | assert.ok(exists(filename)); 58 | assert.end(); 59 | }); 60 | } else { assert.end(); } 61 | }); 62 | 63 | test('should render async to file (guessing format)', (assert) => { 64 | var filename = './test/tmp/renderFile.jpg'; 65 | var map = new mapnik.Map(600, 400); 66 | map.loadSync('./test/stylesheet.xml'); 67 | map.zoomAll(); 68 | map.renderFile(filename, function(error) { 69 | assert.ok(!error); 70 | assert.ok(exists(filename)); 71 | assert.end(); 72 | }); 73 | }); 74 | 75 | test('should render async and throw with invalid format', (assert) => { 76 | var filename = './test/tmp/renderFile2.pdf'; 77 | var map = new mapnik.Map(600, 400); 78 | map.loadSync('./test/stylesheet.xml'); 79 | map.zoomAll(); 80 | try { 81 | map.renderFile(filename, null, function(error) { assert.ok(error); }); 82 | } catch (ex) { 83 | assert.ok(ex); 84 | assert.end(); 85 | } 86 | }); 87 | -------------------------------------------------------------------------------- /test/mapnik-index.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var path = require('path'); 5 | var fs = require('fs'); 6 | var os = require('os'); 7 | var crypto = require('crypto'); 8 | var mapnikindex = path.resolve(__dirname, '..', 'bin', 'mapnik-index.js'); 9 | 10 | var file = path.join(__dirname, 'data', 'world_merc.json'); 11 | 12 | var tmpdir = path.join(os.tmpdir(), crypto.randomBytes(8).toString('hex')); 13 | var tmpfile = path.join(tmpdir, 'world_merc.json'); 14 | 15 | var spawn = require('child_process').spawn; 16 | 17 | test('setup', (assert) => { 18 | fs.mkdir(tmpdir, function() { 19 | fs.createReadStream(file).pipe(fs.createWriteStream(tmpfile)).on('close', function() { 20 | assert.end()}); 21 | }); 22 | }); 23 | 24 | test('should create a spatial index', (assert) => { 25 | var args = [mapnikindex, '--files', tmpfile]; 26 | spawn(process.execPath, args) 27 | .on('error', function(err) { assert.ifError(err, 'no error'); }) 28 | .on('close', function(code) { 29 | assert.equal(code, 0, 'exit 0'); 30 | 31 | fs.readdir(tmpdir, function(err, files) { 32 | 33 | files = files.filter(function(filename) { 34 | return filename === 'world_merc.json.index'; 35 | }); 36 | 37 | assert.equal(files.length, 1, 'made spatial index'); 38 | assert.end(); 39 | }); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /test/mapnik-shapeindex.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var path = require('path'); 5 | var fs = require('fs'); 6 | var os = require('os'); 7 | var crypto = require('crypto'); 8 | var shapeindex = path.resolve(__dirname, '..', 'bin', 'mapnik-shapeindex.js'); 9 | 10 | var shp = path.join(__dirname, 'data', 'world_merc.shp'); 11 | var shx = path.join(__dirname, 'data', 'world_merc.shx'); 12 | var prj = path.join(__dirname, 'data', 'world_merc.prj'); 13 | var dbf = path.join(__dirname, 'data', 'world_merc.dbf'); 14 | 15 | var tmpdir = path.join(os.tmpdir(), crypto.randomBytes(8).toString('hex')); 16 | var tmpshp = path.join(tmpdir, 'world_merc.shp'); 17 | var tmpshx = path.join(tmpdir, 'world_merc.shx'); 18 | var tmpprj = path.join(tmpdir, 'world_merc.prj'); 19 | var tmpdbf = path.join(tmpdir, 'world_merc.dbf'); 20 | 21 | var spawn = require('child_process').spawn; 22 | 23 | test('setup', (assert) => { 24 | fs.mkdir(tmpdir, function() { 25 | fs.createReadStream(shp).pipe(fs.createWriteStream(tmpshp)).on('close', function() { 26 | fs.createReadStream(shx).pipe(fs.createWriteStream(tmpshx)).on('close', function() { 27 | fs.createReadStream(prj).pipe(fs.createWriteStream(tmpprj)).on('close', function() { 28 | fs.createReadStream(dbf).pipe(fs.createWriteStream(tmpdbf)).on('close', function() { 29 | assert.end()}); 30 | }); 31 | }); 32 | }); 33 | }); 34 | }); 35 | 36 | 37 | test('should create a spatial index', (assert) => { 38 | var args = [shapeindex, '--shape_files', tmpshp]; 39 | spawn(process.execPath, args) 40 | .on('error', function(err) { assert.ifError(err, 'no error'); }) 41 | .on('close', function(code) { 42 | assert.equal(code, 0, 'exit 0'); 43 | 44 | fs.readdir(tmpdir, function(err, files) { 45 | 46 | files = files.filter(function(filename) { 47 | return filename === 'world_merc.index'; 48 | }); 49 | 50 | assert.equal(files.length, 1, 'made spatial index'); 51 | assert.end(); 52 | }); 53 | }); 54 | }); 55 | -------------------------------------------------------------------------------- /test/parameters.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | 4 | var test = require('tape'); 5 | var mapnik = require('../'); 6 | 7 | function cleanXml(xml) { 8 | return xml.replace('\n','').split(' ').join(''); 9 | } 10 | 11 | test('should be accessible from map', (assert) => { 12 | var map = new mapnik.Map(1, 1); 13 | map.loadSync('./test/support/extra_arbitary_map_parameters.xml'); 14 | var params = map.parameters; 15 | assert.equal(params.decimal, 0.999); 16 | assert.equal(params.integer, 10); 17 | assert.equal(params.key, 'value2'); 18 | assert.equal(params.integer_one, 1); 19 | assert.equal(params.integer_zero, 0); 20 | assert.equal(params.boolean_yes, true); 21 | assert.equal(params.boolean_no, false); 22 | assert.equal(params.boolean_on, true); 23 | assert.equal(params.boolean_off, false); 24 | assert.equal(params.boolean_true, true); 25 | assert.equal(params.boolean_false, false); 26 | assert.end(); 27 | }); 28 | 29 | test('should be settable on map', (assert) => { 30 | var map = new mapnik.Map(1, 1); 31 | var actual = cleanXml(map.toXML()); 32 | var expected = cleanXml('\n\n'); 33 | assert.equal(actual, expected); 34 | map.parameters = {'a': 'b','bool':false, 'num': 12.2, 'num2': 1}; 35 | actual = cleanXml(map.toXML()); 36 | if (mapnik.versions.mapnik_number >= 300000) { 37 | expected = cleanXml('\n\n \n b\n false\n 12.2\n 1\n\n\n'); 38 | } else { 39 | expected = cleanXml('\n\n \n b\n \n\n'); 40 | } 41 | assert.equal(actual, expected); 42 | assert.end(); 43 | }); 44 | -------------------------------------------------------------------------------- /test/plugin.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | var path = require('path'); 6 | 7 | 8 | test('test registering of datasource', (assert) => { 9 | // Should register fine the first time 10 | // ensure shape input is registered 11 | mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'shape.input')); 12 | // should not register again 13 | var b = mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'shape.input')); 14 | assert.equal(false, b); 15 | 16 | var ds_list = mapnik.datasources(); 17 | var contains = false; 18 | for (var i = 0; i < ds_list.length; i++) { 19 | if (ds_list[i] === 'shape') contains = true; 20 | } 21 | assert.equal(contains, true); 22 | assert.end(); 23 | }); 24 | 25 | test('test registering of datasource - other naming', (assert) => { 26 | // Should register fine the first time 27 | // ensure shape input is registered 28 | mapnik.registerDatasource(path.join(mapnik.settings.paths.input_plugins,'shape.input')); 29 | // should not register again 30 | var b = mapnik.registerDatasource(path.join(mapnik.settings.paths.input_plugins,'shape.input')); 31 | assert.equal(false, b); 32 | 33 | var ds_list = mapnik.datasources(); 34 | var contains = false; 35 | for (var i = 0; i < ds_list.length; i++) { 36 | if (ds_list[i] === 'shape') contains = true; 37 | } 38 | assert.equal(contains, true); 39 | assert.end(); 40 | }); 41 | 42 | 43 | test('should fail to register plugin', (assert) => { 44 | 45 | assert.throws(function() { 46 | mapnik.register_datasource(); 47 | }); 48 | assert.throws(function() { 49 | mapnik.register_datasource(1); 50 | }); 51 | assert.throws(function() { 52 | mapnik.register_datasource('ab', 'c'); 53 | }); 54 | 55 | assert.throws(function() { 56 | mapnik.register_datasources(); 57 | }); 58 | assert.throws(function() { 59 | mapnik.register_datasources(1); 60 | }); 61 | assert.throws(function() { 62 | mapnik.register_datasources('ab', 'c'); 63 | }); 64 | assert.end(); 65 | }); 66 | 67 | test('test registering of multiple datasources', (assert) => { 68 | // Should register fine the first time 69 | // ensure shape input is registered 70 | mapnik.register_datasources(mapnik.settings.paths.input_plugins); 71 | // should not register again 72 | var b = mapnik.register_datasources(mapnik.settings.paths.input_plugins); 73 | assert.equal(false, b); 74 | assert.end(); 75 | }); 76 | 77 | test('test registering of multiple datasources - alternate naming', (assert) => { 78 | // Should register fine the first time 79 | // ensure shape input is registered 80 | mapnik.registerDatasources(mapnik.settings.paths.input_plugins); 81 | // should not register again 82 | var b = mapnik.registerDatasources(mapnik.settings.paths.input_plugins); 83 | assert.equal(false, b); 84 | assert.end(); 85 | }); 86 | -------------------------------------------------------------------------------- /test/raster.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | data/images/sat_image.png 14 | gdal 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/shp2geojson.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var test = require('tape'); 4 | var mapnik = require('../'); 5 | var fs = require('fs'); 6 | 7 | var path = require('path'); 8 | mapnik.register_datasource(path.join(mapnik.settings.paths.input_plugins,'shape.input')); 9 | 10 | test('should convert shapefile', (assert) => { 11 | if (process.versions.node.split('.')[1] !== '6') { 12 | var ds = new mapnik.Datasource({type:'shape',file:'test/data/world_merc.shp'}); 13 | var featureset = ds.featureset(); 14 | var geojson = { 15 | "type": "FeatureCollection", 16 | "features": [ 17 | ] 18 | }; 19 | var feat = featureset.next(); 20 | while (feat) { 21 | geojson.features.push(JSON.parse(feat.toJSON())); 22 | feat = featureset.next(); 23 | } 24 | var actual = './test/tmp/world_merc.converted.geojson'; 25 | var expected = './test/data/world_merc.converted.geojson'; 26 | if (!fs.existsSync(expected) || process.env.UPDATE ) { 27 | fs.writeFileSync(expected,JSON.stringify(geojson,null,2)); 28 | } 29 | fs.writeFileSync(actual,JSON.stringify(geojson,null,2)); 30 | assert.ok(Math.abs(fs.readFileSync(actual).length-fs.readFileSync(expected).length) < 3000); 31 | } 32 | assert.end(); 33 | }); 34 | -------------------------------------------------------------------------------- /test/stylesheet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | style 12 | 13 | data/world_merc.shp 14 | iso-8859-1 15 | shape 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/support/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/support/a.png -------------------------------------------------------------------------------- /test/support/b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/support/b.png -------------------------------------------------------------------------------- /test/support/composites.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 21 | 22 | 23 | one 24 | 25 | csv 26 | 27 | x,y,name 28 | -35,0,one 29 | 30 | 31 | 32 | 33 | 40 | 41 | 46 | 47 | 48 | two 49 | 50 | csv 51 | 52 | x,y,name 53 | 35,0,one 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /test/support/extra_arbitary_map_parameters.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test/support/grid_view.json: -------------------------------------------------------------------------------- 1 | { 2 | "grid": [ 3 | " !#########!!!", 4 | "! ##########!!!", 5 | " !#########!!!", 6 | " !!!!#######!!!", 7 | " !!!!!#######!!!", 8 | " !!!#######!!!", 9 | " !!#######!!!", 10 | " !!#####!!!!", 11 | " ! !###!!$$!!", 12 | " !!##!!!$$!!", 13 | "!! !!!!#!!!!!!!", 14 | "!! !!!!!!!!!!%", 15 | " !!!!!!!!!%", 16 | " !!!!!!!&%", 17 | " ! !!!!!!!!'", 18 | "(( (( !!!!!!!!!!" 19 | ], 20 | "keys": [ 21 | "24", 22 | "", 23 | "71", 24 | "82", 25 | "205", 26 | "51", 27 | "65", 28 | "207" 29 | ], 30 | "data": { 31 | "24": { 32 | "AREA": 909351, 33 | "FIPS": "CA", 34 | "ISO2": "CA", 35 | "ISO3": "CAN", 36 | "LAT": 59.081, 37 | "LON": -109.433, 38 | "NAME": "Canada" 39 | }, 40 | "51": { 41 | "AREA": 6889, 42 | "FIPS": "EI", 43 | "ISO2": "IE", 44 | "ISO3": "IRL", 45 | "LAT": 53.177, 46 | "LON": -8.152, 47 | "NAME": "Ireland" 48 | }, 49 | "65": { 50 | "AREA": 55010, 51 | "FIPS": "FR", 52 | "ISO2": "FR", 53 | "ISO3": "FRA", 54 | "LAT": 46.565, 55 | "LON": 2.55, 56 | "NAME": "France" 57 | }, 58 | "71": { 59 | "AREA": 41045, 60 | "FIPS": "GL", 61 | "ISO2": "GL", 62 | "ISO3": "GRL", 63 | "LAT": 74.719, 64 | "LON": -41.391, 65 | "NAME": "Greenland" 66 | }, 67 | "82": { 68 | "AREA": 10025, 69 | "FIPS": "IC", 70 | "ISO2": "IS", 71 | "ISO3": "ISL", 72 | "LAT": 64.764, 73 | "LON": -18.48, 74 | "NAME": "Iceland" 75 | }, 76 | "205": { 77 | "AREA": 24193, 78 | "FIPS": "UK", 79 | "ISO2": "GB", 80 | "ISO3": "GBR", 81 | "LAT": 53, 82 | "LON": -1.6, 83 | "NAME": "United Kingdom" 84 | }, 85 | "207": { 86 | "AREA": 915896, 87 | "FIPS": "US", 88 | "ISO2": "US", 89 | "ISO3": "USA", 90 | "LAT": 39.622, 91 | "LON": -98.606, 92 | "NAME": "United States" 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /test/support/helper.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var crypto = require('crypto'); 4 | var fs = require('fs'); 5 | 6 | exports.md5File = function(file) { 7 | var data = fs.readFileSync(file, 'binary'); 8 | return crypto.createHash('md5').update(data).digest('hex'); 9 | }; 10 | 11 | exports.md5 = function(data) { 12 | return crypto.createHash('md5').update(data).digest('hex'); 13 | }; 14 | 15 | exports.filename = function(suffix) { 16 | return './test/tmp/file_' + (Math.random() * 1e16).toFixed() + '.' + (suffix || 'png'); 17 | }; 18 | -------------------------------------------------------------------------------- /test/support/palettes/palette256.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/support/palettes/palette256.act -------------------------------------------------------------------------------- /test/support/palettes/palette64.act: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapnik/node-mapnik/3ecc7e669e3f0aed6fdf3ae6b11133a3bd418289/test/support/palettes/palette64.act -------------------------------------------------------------------------------- /test/tmp/placeholder.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/cpp.el: -------------------------------------------------------------------------------- 1 | (defun fixup () 2 | (c-set-style "bsd") 3 | (c-set-offset 'innamespace 0) 4 | (c-set-offset 'template-args-cont 'c-lineup-template-args) 5 | (setq c-basic-offset 4) 6 | (indent-region (point-min) (point-max) nil) 7 | (untabify (point-min) (point-max)) 8 | (delete-trailing-whitespace) 9 | (save-buffer) 10 | ) 11 | 12 | 13 | -------------------------------------------------------------------------------- /tools/fix_cpp_style.sh: -------------------------------------------------------------------------------- 1 | for file in $(find ./src/ -name '*.*') 2 | do 3 | emacs -batch $file -l `pwd`/tools/cpp.el -f fixup 4 | done 5 | 6 | 7 | --------------------------------------------------------------------------------