普通网友 2011-01-18 03:13
浏览 207

动态生成地图

I am looking to generate transport maps in a style similar to the iconic London underground [tube] map.

These maps will change from time to time and many will be required so instead of drawing them up manually in inkscape [or similar] I am hoping to have them generated dynamically from a db or dataset.

Does anyone know if there is any library apis etc. out there that would help with this task, or any suggestions in general of how [or how not] to go about this ?

I am thinking svg's would be the best way to go with this, plus there may be need for basic interactivity down the line.

I am working in php so otherwise it's GDlib, ImageMagick ?

Thanks in advance.

.k

  • 写回答

3条回答 默认 最新

  • doudu8291 2011-01-18 07:38
    关注

    Well, the answer really isnt in how to use GD or ImageMagick, there are manuals for that. As for helper libraries, most libraries focus on graphing, anything else you will have to write yourself. Your best bet as a solution would be to have your admin interface generate the images when data in the backend changes and cache the images, since there's no reason to build the image every time someone accesses it.

    For generating maps, i think your best bet would be defining stations with one or many 'lines' which determine some sort of indicator of relationship to the stations around, and an x,y. You'd probably only need to determine a 'parent' station since you're just drawing lines from a-b. That way you can position them in the same manner as they're typically rendered on the actual trains, use the lines and surrounding stations to draw mappings.

    Doesn't sound like too difficult a problem. 3 tables:

    • stations [stationid,name,x,y,meta1,meta2],
    • placements [placementid,stationid,lineid,parentstationid],
    • lines [lineid,name,meta1,meta2,colour,etc].

    SVG would be pretty good at this sort of thing, and you would avoid the whole image building and caching process, but be wary of browser support issues.

    Sounds like a pretty interesting project though, good luck :)

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器