Giter VIP home page Giter VIP logo

kothic-js's Introduction

   Kothic  Map Renderer
   
   Depends:
   1. tWMS http://twms.googlecode.com/
     symlink twms directory into src/
   2. python-lxml
   3. python-psyco, if available.
   4. pygtk for GUI
   5. pycairo
   6. python-psycopg2
   7. python-shapely
   8. python-pyproj

   To run:
   1. Install all dependancies.
   2. cd src/
   3. cat small_test_osm_dump.osm | python osm2tiles.py
   4. wait a bit and check if tiles got generated
   5. python kothic.py to run GUI

   NOT READY FOR DAILY USAGE!

kothic-js's People

Contributors

braandl avatar dave1010 avatar derdakon avatar komzpa avatar miroff avatar mourner avatar nickw1 avatar oschrenk avatar rurseekatze avatar zhuowei avatar

Stargazers

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

Watchers

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

kothic-js's Issues

json_getter: there's no column transport

psycopg2.ProgrammingError: column "transport" does not exist
LINE 3: ...ferry_terminal')) OR (("natural" = 'water')) OR (("transport...

Seems like the transport key is obsolete.

Undefined styles after initialize

After fixing my intitial problems in #34, i ran into problems with the _onKothicDataResponse function in kothic-leaflet.js

this.kothic = new Kothic({
            buffered: layer.options.buffered,
            styles: layer.options.styles, 
            additionalStyle: layer._additionalStyle,
            locales: ['be', 'ru', 'en']
        });

layer.options.styles was always undefined. The initialize method ddidn't set the correct options object. I included the fix in pull request #34

Strange Opera/Other Browser behaviour in perfomance test

В тесте производительности(Win):

  • опера показывает текст на карте при каждом проходе
  • другие браузеры(IE,FF) показывают текст на карте только после прохождения теста

Support for browsers that don't have text on canvas

Currently, Konqueror has support for canvas but has no functions to work with text on it.

Probably we can add checks for text functions availability and don't render (and don't fail) if they're unavailable.

Javascript stylefile problem: s_everything is not defined

Hello,

I am currently developing an own web application using KothicJS and Leaflet to render a map overlay. But I am having some problems to get this application running.

In my browser's Javscript console I get this error:
Uncaught ReferenceError: s_everything is not defined

This error is caused by the Javascript stylefile.
My stylefile, which I generated with mapcss_converter.py, contains these lines at the end of the function restyle:

if (!K.Utils.isStyleUseful(s_default)) {
    style['default'] = {};
    for (var attrname in s_everything) { style['default'][attrname] = s_everything[attrname]; }
    for (var attrname in s_default) { style['default'][attrname] = s_default[attrname]; }
}
return style;

The stylefile on the example page (http://kothic.org/js/osmosnimki.js) is a bit different at this part of the code and does not contain s_everything:

if (!K.Utils.isEmpty(s_default)) {
    style['default'] = s_default;
}
if (!K.Utils.isEmpty(s_centerline)) {
    style['centerline'] = s_centerline;
}
if (!K.Utils.isEmpty(s_ticks)) {
    style['ticks'] = s_ticks;
}
if (!K.Utils.isEmpty(s_label)) {
    style['label'] = s_label;
 }
 return style;

Why is there a difference between my file and the example file?
I hope you can help me.

Regards
Alex

better text-on-path

  • take geometry into account, try to minimize number of bendings on line;
  • align whitespaces to places where line bends;
  • support MultiLineStrings and (Multi)Ploygons;
  • merge adjacent segments with same label in same font, to allow less labels with effectively the same text;
  • allow label repetition.

Icons not redrawn correctly after zooming

Sometimes icons are not redrawn correctly after changing the zoom level.

If you change the zoom level, you will see that sometimes after zoom-in the icons appear in the intended size, but also in twice as big:
bug
(source: http://www.openrailwaymap.org/?lang=en&lat=51.22263642333937&lon=6.676366925239563&zoom=17&style=signals)

A similar problem happens after zooming out. In this case, the icons are only half of the intended size.

It seems that something with the zooming transition fails. Maybe the resized icons are not removed after re-rendering the canvas layer.

Consistent text rendering in major browsers

This isn't really Kothic's bug but a blocker for release.

0.1 should be released/tarred after:

  • chrome fixes disappearing letters;
  • chrome fixes inconsistent bold;
  • opera fixes blurred text.

Ошибки и проблемы

  1. 5 пункт в сетапе не работает(ни как) - не критично.
  2. Работает только если в скрипте закомментировать строку:
    aaaa["features"].extend(get_vectors(bbox,zoom,style,"line")["features"])
    иначе выдает ошибку(в апаче, http://хост/vtile/src/json_getter.py?z=1&x=1&y=1):
    Traceback (most recent call last):
    File "/var/www/vtile/src/json_getter.py", line 230, in
    aaaa["features"].extend(get_vectors(bbox,zoom,style,"line")["features"])
    File "/var/www/vtile/src/json_getter.py", line 164, in get_vectors
    b.execute(query)
    psycopg2.ProgrammingError: syntax error at or near ")"
    LINE 5: where ()
    ^
  3. При обращении к скрипту через браузер напрямую перед переменными убрал знак доллара, иначе выдавал ошибку(в апаче).
  4. После успешной генерации выдал файлик 1.js, внутри которого только
    {"type":"Polygon","properties":{"natural":"coastline"},"coordinates":[[[координаты менются.....
    Хотя я загружал с OSM(xml) в постгис и реки с дорогами и домами и т.д.(загружал с постгиса в опенгео - все супер).

Testcases needed

An automatic testsuite would be very helpful to catch regressions, and ideally it could be even integrated with Travis CI.

Иконки с подписью в одном объекте

В результате зачисток поломалась логика коллизий для иконок с подписями.
Если у иконки есть подпись, то убирать и показывать их надо только вместе - не нужно допускать ситуации, когда рисуется только иконка, или только подпись.

Adaptive hacks enabling-disabling

Looks like we need some sort of wrapper around Kothic to enable features absent, or broken, in some browsers. Including, but not limited, to:

  • canvas itself - consider FlashCanvas, IECanvas, or some other implementation where canvas isn't available;
  • text rendering - sometimes (broken Chrome/GPU, old browsers, absent fonts) it might be useful to enable canvas-text http://code.google.com/p/canvas-text/ instead of browser's built-in mechanism;
  • enable or disable in-Kothic caching (text measurements, .save/.restore vs. caching of canvas properties) based on benchmark on page load;
  • dashes: there are at least three different methods to implement them (using .translate/.rotate, calculating position in browser, using mozDash).

House numbers Y-axis inverted

Hi,

if you download the trunk codebase, open debug/index.html and zoom in until zoom level 13 (the first with house numbers), you'll see that house numbers that should be at the bottom of the tile are at the top and those who should be at the bottom are at the top, i.e. y was replaced by tile_height - y in the geometry. See picture at http://imageshack.us/f/835/picture1dpi.png/

I was looking at a possible fix by removing the call to this._invertYAxe(data) in kothic_leaflet.js, but this actually inverts the y axis for all the geometries, not only the house numbers.

Only the trunk version is affected. kothic.org/js looks perfectly fine.

Missing renderer.js

When trying to compile my on distribution of kothic the closure compiler (started via make all) complains about a missing src/renderer/renderer.js. it isn't available in the src directory. I guess it has been removed.

Cache map data in Kothic

Now, when tile moved out of visible area, the tile being completely removed from memory. We need to cache preprocessed data to reduce tile loading next time. Bobcat renderer already has cache implementation, so it can be easily copied.

Fake Canvas for debugging and benchmarking other parts of code

Seems like canvas is the slowest part for now, but probably there are others, that aren't seen for now. Can we fake canvas object with something that will accept all the used calls and return immediately, to see only numbers that depend on object sorting?

z-index issues

There are at least 2 z-index issues, which probably need a combined solution, so I report them in one issue:

  • together with allow-overlap z-index is actually reversed as the objects are drawn in decreasing z-index order, and if allow-overlap is set the later object is drawn above the previous one (which has a higher z-index). This cannot be fixed using "globalCompositeOperation='source-over'" as this would draw the new object below everything on the canvas, i.e. also those objects with lower z-index (e.g. geometry). An example of the error can be seen on OpenRailwayMap, the z-index of the white signs corresponds to the number shown on it.
  • the code to render text and icons does one pass through one text/icon combination before rendering the next (see kothic.js), which means a bare icon with low z-index would be drawn first, and a bare text with high z-index would not be drawn at all if it collides with this icon.

Include elevation data in tiles

Purpose is to pre-process elevation data such as SRTM, and include it as vector data in tiles, in order to allow rendering of contour and / or hillshading.

json_getter: There is no coastline table

This is what I get when I use json_getter:

Traceback (most recent call last):
  File "json_getter.py", line 226, in <module>
    aaaa = get_vectors(bbox,zoom,style,"coastline")
  File "json_getter.py", line 163, in get_vectors
    b.execute(query)
psycopg2.ProgrammingError: relation "coastlines" does not exist
LINE 5:                      coastlines

These are the tables I have:

planet_osm_line
planet_osm_nodes
planet_osm_point
planet_osm_polygon
planet_osm_rels
planet_osm_roads
planet_osm_ways

Add more user side debugging features

Currently there is no way to say what went wrong when you end up with a bunch of gray tiles and some rendered ones. There should be some kind of possibility to extend the current debugging info (layers styled, map rendered, icons/text rendered).

Things that would be helpful:
*Tile number
*Whether data needed for rendering has been downloaded successfully or not

Maybe this info can be added as a half transparent layer (so that info for each tile is shown inside that tile) that can be switched on when necessary.

Empty dist/kothic.js

With the last commit, the distribution file was overwritten with empty content. I guess this was not deliberate. Could you add it again?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.