Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - kech61

#166
Quote from: "gynta"Für Einsteiger könnte diese Angabe ohne nähere Erklärung oder einem Beispiel etwas schwer nachvollziebar sein.
So gut die Lösung auch ist... ;)

 8-)  Tschuldigung, ist völlig richtig -  mit Tapatalk soll't man sowas nicht machen...

Hier ein Beispiel für "bakery" , das funktioniert mit allen pois analog.
Als erstes muss man eine custom theme anlegen (so nicht schon vorhanden), es gibt mittlerweile einige hier im Forum.
Wenn die originale theme ausreichend ist muss sie trotzdem (anders benannt) als custom theme installiert werden
da die originale fix in Locus verdrahtet ist.

Wie komme ich an die originale theme?
- Die viewer-app von Mapsforge runterladen: //http://mapsforge.googlecode.com/files/AdvancedMapViewer.apk
- umbenennen in AdvancedMapViewer.zip, jetzt kannst Du die app als normale Dateistruktur betrachten (ich empfehle dafür den TotalCommander)
- Die theme ist in AdvancedMapViewer.ziporgmapsforgeandroidmapsrenderthemeosmarender
- rauskopierren, unbenennen
- die pfade in der osmarender.xml anpassen
= Suchen/ersetzen von "jar:/org/mapsforge/android/maps/rendertheme/osmarender/" zu "file:/"
- abspeichern, in locus installieren


Die Symbole :

Dann einfach 2 verschieden grosse Symbole ertellen
- eins mit zB 20/20 pixel grösse
- eins mit zB 32/32 pixel grösse

oder ein vorhandenes aus dem /symbol folder vergrössern oder verkleinern und eindeutig benennen,
die entsprechende Rule in der [theme].xml kopieren und mit den zoom-min[max] tags versehen.

Im unten stehenden Beispiel wird das grössere Symbol ab dem zoom-level 16 wirksam, das kleinere gilt von level 13-15, wobei die Angabe von zoom-min="13" eigentlich unnötig ist da da kleine Symbol ohnehin erst ab level 13 dargestellt wird (definiert in der tag-maping.xml).

EDIT: Die meisten Symbole werden erst ab level 16-17 dargestellt, das kann man nur ändern wenn man die Karte selbst neu estellt nachdem die tag-mapping.xml angepasst wurde - aber das ist ein _ganz_ anderes Thema....

                       
<rule e="node" k="shop" v="bakery" zoom-min="13" zoom-max="15">
           <symbol src="file:/symbols/bakery_20.png" />
</rule>
<rule e="node" k="shop" v="bakery" zoom-min="16">
           <symbol src="file:/symbols/bakery_32.png" />
</rule>

Für arbeiten an xml-datein empfehle ich den Notepad++, ist kostenlos und kann mit UTF8 sauber umgehen.

Klingt fürs Erste ev. kompliziert, ist aber wirklich kein Problem wenn man es erst mal gemacht hat.

Grüsse
Christian aus der Wachau
#167
Die Lösung ist einfach;

verschieden grosse symbole erstellen und den jeweiligen zoom_leveln zuweisen.
Normalerweise reichen 2 grössen.

best regards
Christian

sent with tapatalk
#168
Quote from: "tommi62"@Christian/kech61: Could this be the same  problem as discussed here: https://groups.google.com/d/topic/mapsf ... discussion

Thanks, thats it.

So we have to live with this issue, no real problem so far.

best regards
Christian
#169
Hello,

I found a problem when switching between zoom-levels:

The render rules of "Pathtext" are sometimes ignored,
I set different font-sizes (for roads and cycle routes) for the zoom-levels and these are (sometimes) ignored, this means the size for the lowest zoom leves stays active for all levels.
Most of the time this problem could be solved by switching to a an other map, clearing locus-cache and switching back.

@menion: could you take a look at this issue - thanks.

best regards
Christian
#170
Hi,

Clear the cache, this should solve your problem.

Christian

Gesendet von meinem ST17i mit Tapatalk 2
#171
Themes - Vector maps / Re: [Theme] OSM Cyclo
May 19, 2012, 10:55:28
Hello,

I'm shure that Thilo from the mapsforge-team will solve most of our technical issues in the future.

Please dont put too much preasure on him  ;) , as I experienced he is a one-man-show in wide areas of this project,
and I dont want that he leaves this project in frustration - the work he had done its way to precious for the community.

For me the tech-issues are solved far enough to make a version freeze this weekend, the quality of the cycle routes matches Andy Allens OpenCycleMap in wide areas - I developed the resolving scripts with an eye on his maps.
Most of the problems I experienced the last weeks had nothing to do with technics but with wrong tagged relations - I had to find a ballance between skipping them and setting rules (AND code them) that handle suspicious data with additional general rules.

So 50% of the work is done, now the anoying stuff starts, basicly setting up a website, finding sponsors for bandwidth, proteting against download-crawlers, writing the legal stuff, asking for permission to use the contour data of viewfinderpanoramas (its only free for personal use), _maybe_ providing themes for different apps (Locus is the only app I'v seen so far where the implementation of custom themes _PLUS_ symbols is rock-solid) aso......

OK, the sun is shining, my Kayak is waiting eagerly in the garage .... :mrgreen:

best regards
Christian aus der Wachau
#172
Themes - Vector maps / AW: [Theme] OSM Cyclo
May 18, 2012, 22:42:57
Hello,

Making Cycle maps is a complicated task. A theme is 1% of the job. Mapsforge can only render nodes and ways - cycle and hiking ways are organized in relations...

Wait 2 weeks, Cycle Maps will be available, I promisse..

Christian

Gesendet von meinem ST17i mit Tapatalk 2
#173
Quote from: "menion"Netherland map have highest concentration of items on same area compare to other countries. So at one zoom level, your phone needs to handle more data then on different areas ...

Hello,

Same Problem with Netherlands / northern Belgium / NL/DE-Border occurs with other custom maps, even without contour lines - there are not so many in NL ;-) .

As an example:
The Netherlands have 270000 cycle ways referencing to a relation, PLUS 130.983 ways tagged as highway=cycleway and 9480 cycle nodes (ovelapping collissions with distance <5m already filtered out....).
IMO no other country has such a detailed OSM-Database (and btw. such an accurate tagging) - a real challenge for a simple Phone...

For low-memory phones like my XperiaActive a custom tag-mapping.xml will be essential for those areas, reducing the details in Levels 6-10 (or whatever one choose for the mid-range-area of the mapwriter).

Not only Locus is crashing, all other mapping apps too.

Edit: Mhhhh.. I have not the slightest idea of Java-coding yet, but.. might it be possible that there are some array-dims or mem-allocations that run out of their range within the mapviever library ??

best regards
Christian
#174
Hello Jurajs,

Im finally here on Locus-Forum, is ways more responsive than Mapsforge-Dev and I hate GoogleGroups :-)
For you Toppic: I create polys as tracks in TTQV (any other MappingTool is possible) and export the tracks as gpx.

I wrote/modified two perlscripts to convert poly2gp and vice-versa.

The gpx2poly script has an additional feature for MapsforgeWriter, it writes a .bat file with the parameters (bbox!!) used for creating the map fitting the borders of the poly-file. The paths are fixed coded for my folder structure but its a matter of a few minutes to adjust this to your needs.

poly2gpx.pl:
#!/usr/bin/perl -w
#
# poly2gpx.pl - convert a polygon file to GPX
#
#  see http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format
#  for the format of the polygon files
#
# Author: Hanno Hecker <vetinari+osm@ankh-morp.org>
#
# modified for windows (direct input/output from/to file - no more hassle with pipelines)
# made code more readable, this adds some milliseonds to processing time ;-)
# by Christian Kernbeis 2012
#
# Licence: GPL v3.0
# Version: 0.4.1
#
# usage: poly2gpx.pl [filename] WITHOUT EXTENSION
# eg: poly2gpx.pl austria = OK
#  poly2gpx.pl austria.poly = WRONG !!!
#
############################################################################################

use strict;
use Math::Polygon;
use Carp qw( croak );
use Getopt::Long;

my $VERSION = "0.4.1";

my $name  = undef;
my $trans = undef;
my $use_name = 0;

my $polyname = shift;
my $infile = $polyname.".poly";
my $outfile = $polyname.".gpx";


my @nodes    = ();
my $line;
my @infile;
my $trkseg   = 0;
my $trknum   = 0;


#read infile to array
open (IN,"<",$infile) || die("Could not open $infile ...");
while ($line = <IN>){
#print $line; # for testing only
push (@infile, $line);
}
close (IN);

open (out1,">",$outfile) || die("Could not open $outfile ...");

print out1 <<__END;
<?xml version='1.0' encoding='UTF-8'?>
<gpx version="1.1" generator="poly2gpx.pl v$VERSION"
    xmlns="http://www.topografix.com/GPX/1/1">
 <metadata>
  <name></name>
  <desc></desc>
  <author>
   <name></name>
   <email domain="" id=""/>
  </author>
  <copyright author="">
  <year></year>
  <license></license>
  </copyright>
 </metadata>
__END

foreach $line (@infile) {
    if ($line =~ /^s*!?(d+)s*$/) {
        $trknum = $1;
        print out1 " <trk>n",
              "  <trkseg>n";
        $trkseg = 1;
    }
    elsif ($line =~ /^s*ENDs*$/) {
        if ($trkseg) {
            $trkseg = 0;
            $trknum = 0;
            print out1 "  </trkseg>n </trk>n";
        }
        else {
            if ($use_name and defined $name) {
                if ($trans) {
                    eval $trans;
                    if ($@) {
                        warn "WARNING: transformation of $name failed: $@n";
                    }
                }

                if ($nodes[0][0] != $nodes[-1][0] and $nodes[0][1] != $nodes[-1][1]) {
                    push @nodes, $nodes[0];
                    warn "WARNING: polygon '$name' is not closed...n";
                }

                my $poly = Math::Polygon->new(@nodes);
                my $lat_lon = eval { $poly->centroid; }; # see below
                if ($@) { warn $@; }   # ... not here, at the end of the file
                else {
                    #$name = encode_entities_numeric($name);
                    $name =~ s/&/&amp;/g;
                    $name =~ s/</&lt;/g;
                    $name =~ s/>/&gt;/g;
                    printf out1 " <wpt lat="%.7f" lon="%.7f">n  <name>%s</name>n </wpt>n",
                            @{ $lat_lon }, $name;
                }
            }
            print out1 "</gpx>n";
        }
    }
    elsif ($line =~ /^s+([-+d.Ee]+)s+([-+d.Ee]+)s*$/) {
        printf out1 "   <trkpt lat="%.7f" lon="%.7f"/>n", $2, $1;
        push @nodes, [$2, $1]
          if $use_name and $trknum == 1;
    }
    elsif ($line =~ /^(S+)/ and not defined $name) {
        $name = $1
          if $1 ne "polygon";
    }
}
close (out1);
print "### DONE ###";

gpx2poly.pl
#!/usr/bin/perl

# script to convert a GPX file to a polygon file.
#
# written by Rodolphe Quiédeville <rodolphe@quiedeville.org>, GPL.
#
# Modified for better usability = no more ">" "|", direct file output
# so it's suitable for Windows environment and so on ....
# ensured compatibility with "GPX10" output of tracks from QuoVadis6.0
#
# by Christian Kernbeis 2012, GPL
#
# Scipt have to be started in the directory of th gpx-file !!
#
# usage: eg given file = austria.gpx
# call = gpx2poly.pl austria
# output is written to austria.poly
#  + map_austria.bat = batch for creating mapsforge map with bbox parameters


use strict;

my $infile = shift;

my $poly_id = 0;
my $poly_file;
my $polybuf;
my $outbuf;
my $id=0;
my $fh;
my $line;
my $inextension = "gpx";
my $outextension = "poly";
my $infilestring = "\maps\osm_data\my_clipbounds\europe\".$infile.".".$inextension;
my $outfilestring = "\maps\osm_data\my_clipbounds\europe\".$infile.".".$outextension;
my $bboxfile = "map_".$infile.".bat";

my @latbuff;
my @lonbuff;

my $bbox;

my $min_lat;
my $max_lat;
my $min_lon;
my $max_lon;



#open file
open (fh, $infilestring) or die $!;

while($line = <fh>)
{
if ($line =~ /^s*<trkpt.*slat=["']([0-9.eE-]+)["'] lon=["']([0-9.eE-]+)["']/){
       $polybuf .= sprintf "t%ft%fn", $2,$1;
push (@lonbuff, $2);
push (@latbuff, $1);
}
   elsif ($line =~ /^s*<trk>/){
       $polybuf = "";
       $poly_id++;
   }
   elsif ($line =~ /^s*</trk>/){
       $outbuf .= "$poly_idn$polybuf"."ENDn";
   }
}
close (fh);

open (fh,">",$outfilestring) or die $!;
print fh "$infilen$outbuf"."ENDn";
close fh;


@latbuff = sort { $a <=> $b } @latbuff;
@lonbuff = sort { $a <=> $b } @lonbuff;
$min_lat = @latbuff[0] - 0.0005; #runden auf 3 stellen genau FLOOR
$min_lon = @lonbuff[0] - 0.0005;
@latbuff = reverse sort { $a <=> $b } @latbuff;
@lonbuff = reverse sort { $a <=> $b } @lonbuff;
$max_lat = @latbuff[0] + 0.0005; #runden auf 3 stellen genau CEIL
$max_lon = @lonbuff[0] + 0.0005;


$bbox=
"bbox="
.sprintf ("%.3f",$min_lat)
.","
.sprintf ("%.3f",$min_lon)
.","
.sprintf ("%.3f",$max_lat)
.","
.sprintf ("%.3f",$max_lon);

open (fh,">",$bboxfile) or die $!;
print fh "d:\maps\osmosis\bin\osmosis_e.bat --rb file=D:\maps\Mapsforge\$infile\$infile","_merged.osm.pbf --mw file=D:\maps\Mapsforge\$infile\$infile.map $bbox tag-conf-file=D:\maps\Mapsforge\tag-mapping-cycle.xml bbox-enlargement=5nexitn";
close fh;
print "$bbox";

The scripts are running both on ActivePerl and StrawberryPerl for Windows and should be copied as usual to perlperlsitebin

regards
Christian