banniere

Le portail francophone de la géomatique


Toujours pas inscrit ? Mot de passe oublié ?
Nom d'utilisateur    Mot de passe              Toujours pas inscrit ?   Mot de passe oublié ?

Annonce

Rencontres QGIS 2025

L'appel à participation est ouvert jusqu'au 19 janvier 2025!

#1 Tue 03 June 2008 19:04

nicolasa
Juste Inscrit !
Date d'inscription: 3 Jun 2008
Messages: 4

[Mapserver] Layer non affiché a cause d'unité differente ?

Bonjour à tous.
Je suis un newbie en Mapserver et j'espere que ma question est pertinente.
Mon fichier .map reference 3 layers Mapinfo (.tab)
Les 2 premiers layers sont visibles sans probleme. Le 3 eme lui ne l'est pas.
Voici le fichier Map

Code:

MAP
DEBUG on
NAME securelev
SIZE 600 518
STATUS ON
EXTENT 152.96586 -27.43460 153.00325 -27.40216

UNITS KILOMETERS
IMAGECOLOR 255 255 255
TEMPLATEPATTERN "securelev"

IMAGETYPE PNG
#FONTSET "..\etc\fonts.txt"
#SYMBOLSET "..\etc\shade.sym"

#
#          Start of web interface definition
#

SYMBOL
    NAME 'circle'
    TYPE ELLIPSE
    POINTS 1 1 END
    FILLED TRUE
END

WEB
    LOG "C:\Program Files\ms4w\Apache\htdocs\secureleve\logs\logs.txt"
    HEADER "templates/header.html"
    TEMPLATE "main.html"
    FOOTER "templates/footer.html"  
    #IMAGEPATH "c:/tmp/ms_tmp/"
    #IMAGEURL "/ms_tmp/"
    #MAXSCALE 10000
    #MINSCALE 0
END # WEB Section

REFERENCE
   IMAGE images/img_overview_securelev.gif
EXTENT 1 1 2 2
#EXTENT 495000 6970200 502400 6963800
  STATUS ON
  COLOR -1 -1 -1
  OUTLINECOLOR 255 0 0
  SIZE 120 90
END

QUERYMAP
  STYLE HILITE
  COLOR 255 0 0
END
#
#          Start of Layer definition
#


LAYER
    NAME "arrondissements"
    TYPE POLYGON
    MINSCALE 0
    MAXSCALE 1000000
    STATUS DEFAULT
    CONNECTIONTYPE OGR
    CONNECTION "C:\projets\sig\demos\securelev\arrondissements.TAB"
        CLASS
            NAME "arrondissements"
            COLOR -1 -1 -1
            OUTLINECOLOR 0 255 0
        END # Class section
END # LAYER Section


LAYER
    NAME "Roads"
    TYPE LINE
    MINSCALE 0
    MAXSCALE 1000000
    STATUS DEFAULT
    CONNECTIONTYPE OGR
    CONNECTION "C:\projets\sig\demos\securelev\Roads.TAB"
        CLASS
            NAME "Roads"
            COLOR 208 208 208
        END # Class section
END # LAYER Section


LAYER
    NAME "ecoles"
    TYPE POINT
    #MINSCALE 0
    #MAXSCALE 1000000
    STATUS DEFAULT
    CONNECTIONTYPE OGR
    CONNECTION "C:\projets\sig\demos\securelev\ecoles.TAB"
        CLASS
            NAME "ecoles"
            COLOR 0 0 0
            SYMBOL 'circle'
            SIZE 1000000
        END # Class section
END # LAYER Section

END # MapFile

Le layer "ecoles" n'est pas visible.
Comme conseillé par ObiWan Kenobi "Use the source, Luke". Le probleme lors du dessin est que je me fais clipper par l'extent visiblement parce que un extent en kilometres est comparé avec des degrées(OGRLayer::FilterGeometry ligne 783 de ogrlayer.cpp)
voilà la callstack.

Code:

     gdal15.dll!OGRLayer::FilterGeometry(OGRGeometry * poGeometry=0x026a1e40)  Line 782    C++
     gdal15.dll!IMapInfoFile::GetNextFeature()  Line 258 + 0x26 bytes    C++
     libmap.dll!msOGRFileNextShape(layer_obj * layer=0x0259f958, shapeObj * shape=0x0012f4c4, ms_ogr_file_info_t * psInfo=0x026a1550)  Line 1181 + 0x15 bytes    C++
     libmap.dll!msOGRLayerNextShape(layer_obj * layer=0x0259f958, shapeObj * shape=0x0012f4c4)  Line 1850 + 0x11 bytes    C++
     libmap.dll!msLayerNextShape(layer_obj * layer=0x0259f958, shapeObj * shape=0x0012f4c4)  Line 144 + 0x16 bytes    C
     libmap.dll!msDrawVectorLayer(map_obj * map=0x02596df8, layer_obj * layer=0x0259f958, imageObj * image=0x0264fc68)  Line 860 + 0xd bytes    C
     libmap.dll!msDrawLayer(map_obj * map=0x02596df8, layer_obj * layer=0x0259f958, imageObj * image=0x0264fc68)  Line 722 + 0x11 bytes    C
     libmap.dll!msDrawMap(map_obj * map=0x02596df8, int querymap=0x00000000)  Line 432 + 0x11 bytes    C
     libmap.dll!msGenerateImages(mapservObj * msObj=0x02595d20, char * szQuery=0x00000000, int bReturnOnError=0x00000001)  Line 3409 + 0xe bytes    C
     mapserv.exe!main(int argc=0x00000002, char * * argv=0x025942b0)  Line 1253 + 0x14 bytes    C

En utilisant ogrinfo sur le arrondissements.tab et sur ecoles.tab j'obtiens les resultats suivants :

Code:

Had to open data source read-only.
INFO: Open of `C:\projets\sig\demos\securelev\arrondissements.tab'
      using driver `MapInfo File' successful.

Layer name: arrondissements
Geometry: Unknown (any)
Feature Count: 7
Extent: (152.947878, -27.456762) - (153.024043, -27.386528)
Layer SRS WKT:
GEOGCS["unnamed",
    DATUM["Australian_Geodetic_Datum_84",
        SPHEROID["Australian",6378160,298.25],
        TOWGS84[-134,-48,149,-0,-0,-0,0]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
SUBURB: String (30.0)
Population: Real (0.0)
OGRFeature(arrondissements):1
  SUBURB (String) = SOMMERTON
  Population (Real) = 4513
  Style = BRUSH(fc:#000000,bc:#ffffff,id:"mapinfo-brush-1.ogr-brush-1");PEN(w:3px,c:#00ff00,id:"mapinfo-pen-2.ogr-pen-0")
  POLYGON ((152.947878 -27.431833,152.94841400000001 -27.434335,152.94939299999999 -27.435585,152.95097899999999 -27.440992999999999,152.95665099999999 -27.441835,152.959901 -27.442312,152.961151 -27.442495,152.96217999999999 -27.442637999999999,152.970213 -27.443709999999999,152.97023100000001 -27.443535,152.97099600000001 -27.442312,152.971416 -27.441996,152.97169500000001 -27.441590999999999,152.972309 -27.441481,152.97264200000001 -27.441582,152.97304199999999 -27.441793,152.973454 -27.441859999999998,152.97381200000001 -27.442039,152.97454099999999 -27.442509,152.975076 -27.438583,152.979266 -27.439245,152.979849 -27.439308,152.980648 -27.439429,152.981326 -27.43953,152.98174 -27.439592999999999,152.98188999999999 -27.43793,152.98279700000001 -27.4329,152.982844 -27.432569,152.98603900000001 -27.433022,152.986075 -27.432753000000002,152.98662999999999 -27.432836000000002,152.98715899999999 -27.432905000000002,152.98747499999999 -27.432848,152.98783800000001 -27.432658,152.98809299999999 -27.432555,152.987968 -27.433183,152.98907199999999 -27.433295,152.98958500000001 -27.433368000000002,152.99071599999999 -27.43353,152.99092200000001 -27.432645,152.991412 -27.429957000000002,152.991556 -27.429172999999999,152.99171799999999 -27.428280999999998,152.991883 -27.427382,152.992344 -27.427447999999998,152.99247700000001 -27.426717,152.99261300000001 -27.425937,152.995159 -27.426275,152.99532099999999 -27.425374,152.99489800000001 -27.425332999999998,152.995294 -27.423292,152.995341 -27.423079,152.997533 -27.423428,152.997962 -27.423514,152.99826899999999 -27.423608000000002,152.99852799999999 -27.423707,152.99856 -27.423715999999999,152.99858900000001 -27.423196,152.99853400000001 -27.422511,152.99831399999999 -27.421828999999999,152.998334 -27.421821,152.99834799999999 -27.421813,152.99836199999999 -27.421803,152.99837299999999 -27.421793,152.99838399999999 -27.421779,152.99839299999999 -27.421765,152.998403 -27.421745999999999,152.99841000000001 -27.421727,152.998412 -27.421714,152.998414 -27.421696,152.99841499999999 -27.421685,152.99841499999999 -27.421672,152.998414 -27.421657,152.998411 -27.421645000000002,152.99840699999999 -27.421631999999999,152.998402 -27.421619,152.99839499999999 -27.421606,152.99838700000001 -27.421593999999999,152.998379 -27.421582999999998,152.99836300000001 -27.421568,152.998434 -27.421492,152.99844899999999 -27.421465999999999,152.99846500000001 -27.421420999999999,152.99847600000001 -27.421379999999999,152.99849 -27.42132,152.998796 -27.419975,152.99697399999999 -27.419695,152.996824 -27.419657999999998,152.996847 -27.419547,152.996994 -27.418762,152.997512 -27.418811000000002,152.99811299999999 -27.418731,152.998186 -27.418704999999999,152.99823699999999 -27.418662999999999,152.99826999999999 -27.41861,152.99828199999999 -27.418572,152.998279 -27.418507000000002,152.99825200000001 -27.418451,152.997635 -27.417698,152.99759399999999 -27.417659,152.99752699999999 -27.417628,152.997209 -27.417581999999999,152.99733900000001 -27.416851,152.997501 -27.415962,152.99755500000001 -27.415354,152.99794399999999 -27.415192,152.997703 -27.414539,152.997646 -27.414422999999999,152.99747099999999 -27.414089,152.99701300000001 -27.413792,152.99673100000001 -27.413671,152.99650399999999 -27.413533,152.995991 -27.413219000000002,152.99573899999999 -27.413073,152.995251 -27.412887999999999,152.99495300000001 -27.412921999999998,152.99487300000001 -27.412851,152.994789 -27.412749999999999,152.99474699999999 -27.412628000000002,152.99435 -27.412592,152.994045 -27.412663999999999,152.993607 -27.412873999999999,152.99345400000001 -27.412887999999999,152.99331699999999 -27.412860999999999,152.993065 -27.412655,152.992771 -27.412758,152.992165 -27.413215999999998,152.99148600000001 -27.413891,152.99109999999999 -27.414532,152.99056200000001 -27.415018,152.99034900000001 -27.415368999999998,152.989925 -27.415929999999999,152.989655 -27.416134,152.98939100000001 -27.416107,152.989273 -27.415908999999999,152.98897600000001 -27.415673999999999,152.98871199999999 -27.415379,152.988529 -27.41523,152.988529 -27.41506,152.988461 -27.414764000000002,152.98842999999999 -27.414708999999998,152.988178 -27.414684,152.98790399999999 -27.414460999999999,152.98757599999999 -27.413916,152.98751799999999 -27.413719,152.98740000000001 -27.413532,152.98736600000001 -27.413212,152.98709500000001 -27.412766,152.986885 -27.412562999999999,152.986729 -27.412355000000002,152.98656099999999 -27.412251,152.98650699999999 -27.412237,152.98584399999999 -27.412209,152.98556099999999 -27.412146,152.98468399999999 -27.412133999999998,152.984531 -27.411999000000002,152.984554 -27.411873,152.98468399999999 -27.411724,152.98450099999999 -27.411698999999999,152.984238 -27.411698999999999,152.98397399999999 -27.411724,152.983799 -27.411626999999999,152.98361199999999 -27.411503,152.98341400000001 -27.411503,152.98325 -27.411698999999999,152.98308599999999 -27.411836999999998,152.98301799999999 -27.411823999999999,152.98288700000001 -27.411798,152.982471 -27.411798,152.982517 -27.411439999999999,152.982517 -27.411242,152.98241400000001 -27.411090999999999,152.982124 -27.410982,152.98193699999999 -27.410858,152.981773 -27.410622,152.980682 -27.410049,152.98056 -27.410513000000002,152.98055600000001 -27.410527999999999,152.98055400000001 -27.410544000000002,152.98055400000001 -27.410565999999999,152.980557 -27.410585999999999,152.98056099999999 -27.410602,152.98056700000001 -27.410616999999998,152.98057600000001 -27.410634999999999,152.980591 -27.410653,152.980605 -27.410665999999999,152.98062100000001 -27.410677,152.980638 -27.410685,152.980512 -27.411061,152.979974 -27.413782,152.97965500000001 -27.415427,152.97959900000001 -27.415652,152.97946300000001 -27.416353999999998,152.979331 -27.417086,152.97924399999999 -27.417531,152.97915800000001 -27.418037000000002,152.978714 -27.418752999999999,152.978272 -27.419477,152.97809699999999 -27.419682000000002,152.97752299999999 -27.420093,152.97607099999999 -27.421019999999999,152.97551300000001 -27.421381,152.974898 -27.421769,152.974198 -27.422208999999999,152.973353 -27.422702999999998,152.97317699999999 -27.423241999999998,152.972084 -27.423815,152.97199499999999 -27.42398,152.971924 -27.424467,152.968504 -27.423888000000002,152.966409 -27.423573,152.965844 -27.425449,152.95955900000001 -27.424458999999999,152.951437 -27.423179,152.95146299999999 -27.424655,152.952607 -27.426183000000002,152.95297500000001 -27.427039,152.95348300000001 -27.427287,152.95448500000001 -27.427648,152.955626 -27.429013999999999,152.95749699999999 -27.42999,152.951188 -27.432438,152.947878 -27.431833))

OGRFeature(arrondissements):2
  SUBURB (String) = EASTGROVE
  Population (Real) = 2972
  Style = BRUSH(fc:#000000,bc:#ffffff,id:"mapinfo-brush-1.ogr-brush-1");PEN(w:3px,c:#00ff00,id:"mapinfo-pen-2.ogr-pen-0")
...

pour ecoles :

Code:

Had to open data source read-only.
INFO: Open of `C:\projets\sig\demos\securelev\ecoles3.TAB'
      using driver `MapInfo File' successful.

Layer name: ecoles3
Geometry: Point
Feature Count: 8
Extent: (497388.737729, 6966549.662291) - (499641.527103, 6968160.630128)
Layer SRS WKT:
PROJCS["unnamed",
    GEOGCS["unnamed",
        DATUM["Australian_Geodetic_Datum_84",
            SPHEROID["Australian",6378160,298.25],
            TOWGS84[-134,-48,149,-0,-0,-0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",153],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",10000000],
    UNIT["Meter",1.0]]
Name: String (40.0)
Suburb: String (15.0)
Number_of_Students: Integer (0.0)
OGRFeature(ecoles3):1
  Name (String) = Somner Park Primary School
  Suburb (String) = SOMNER PARK
  Number_of_Students (Integer) = 412
  Style = SYMBOL(a:45,c:#000000,s:18pt,id:"mapinfo-sym-39.ogr-sym-5")
  POINT (499641.52710286394 6968160.6301281704)

OGRFeature(ecoles3):2
  Name (String) = Main State High
  Suburb (String) = SOMMERTON
  Number_of_Students (Integer) = 1256
  Style = SYMBOL(a:45,c:#000000,s:18pt,id:"mapinfo-sym-39.ogr-sym-5")
  POINT (499014.23870077991 6967363.6495091151)
...

La difference principale est selon moi l'unité utilisée. Pour l'un en degrés pour l'autre en metres.
Mes questions:
- Mon analyse vous semble elle correcte ?
- Comment puis je modifier le fihcier ecoles.tab afin que l'unité utilisée soit degrés.
J'ai fais de nombreux essais dans Mapinfo sans y parvenir.
J'ai tenté de changer l'unité du fichier .map en dd et le probleme existe encore

Pouvez vous m'aider ?
Nicolas

Hors ligne

 

#2 Tue 03 June 2008 21:30

Guillaume Sueur
Participant assidu
Lieu: Toulouse
Date d'inscription: 23 Sep 2005
Messages: 331
Site web

Re: [Mapserver] Layer non affiché a cause d'unité differente ?

ton analyse est bonne, il te faut reprojeter le layer qui ne s'affiche
pas dans la projection des deux autres :
ajoute un bloc PROJECTION au bloc MAP qui définira la projection de la carte
ajoute un bloc PROJECTION dans tous les blocs LAYER qui ne sont pas dans
la projection de la carte, en y spécifiant la projection de ce LAYER.
par exemple :
PROJECTION
         "init=epsg:27572"
END
pour du Lambert II étendu

concernant les unités du bloc MAP, il faut indiquer celles de la
projection utilisée : DD si c du non-projeté (WGS, EPSG:4326) ou METERS
pour du lambert

Bonne chance !

Guillaume

Hors ligne

 

#3 Wed 04 June 2008 01:33

nicolasa
Juste Inscrit !
Date d'inscription: 3 Jun 2008
Messages: 4

Re: [Mapserver] Layer non affiché a cause d'unité differente ?

GENIAL !!!! ça fonctionne maintenant.
Comme indiqué par Guillaume
dans la section MAP j'ai ajouté :
PROJECTION
    "init=epsg:4203"
END
UNITS DD
dans la section Layer du layer qui ne s'affichait pas j'ai ajouté :
    PROJECTION
        "init=epsg:20356"
    END

MERCI encore Guillaume. :-)

Hors ligne

 

Pied de page des forums

Powered by FluxBB