Autocad.dwg for SVG for slabs for PolyMap, which leads to event planning

I am currently saving the .dwg file as .dxf, opening it in Illustrator, saving it as .svg, and then pasting it into an html document using Polymaps . The desired result is to have an event floor plan. Floor plan is more than 1 million square meters. Feet, so I think tiles are the only way to get something that can be used with mobile devices (due to load time)

I cannot find information on how to create tiles from an SVG file and then use them with Polymaps. I am not familiar with this, although I have fully read the Polymaps documentation, I'm not sure I can implement it even after you have the tiles.

I would appreciate any resources for creating .svg tiles that you can use with Polymaps, as well as more detailed examples of using Polymaps.

Thanks,

Chris

+6
source share
1 answer

While Polymaps has SVG support, one simple option is to export the SVG as a very large image, and then use the map parsing utility to export it.

I just tried GDAL, which seems to be used to use many commercial tools. The general is here: http://www.gdal.org/

A quick recipe for creating map tiles from a large raster image.

  • For OSX, you can download the GDAL utility precompilation here: http://www.kyngchaos.com/software/frameworks

  • Run the installer, then open a terminal and export Python scripts to your path:

    export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH

  • Use the gdal2tiles command to create your snippets. http://www.gdal.org/gdal2tiles.html Here is the command I made that creates a bunch of snippets, and a sample html openlayers demos! from your source.

    gdal2tiles.py -p 'raster' largeexported_image.png -z 2-5

If you want to use Polymaps in particular, I believe that it is possible to consume tiles exported from gdal, but I have not tried it. This should satisfy your need for creating clean JS tiles in HTML.

0
source

Source: https://habr.com/ru/post/904173/


All Articles