Ta yaya Workserver Works

A baya lokacin da muka yi magana game da wasu sharuddan dalilin da ya sa MapServer da kuma kayan aikin yau da kullun. Yanzu bari mu ga wasu ayyukanta a cikin atisaye tare da taswirar abokan Chiapas.

 mai kula da geoserver Inda aka saka

Da zarar an shigar da Apache, jagorar da aka buga na MapServer shi ne babban fayil na OSGeo4W kai tsaye kan C: /

A ciki, akwai manyan fayiloli daban-daban tare da aikace-aikace dangane da abin da aka shigar, amma babban fayil ɗin don bugawa dole ne ya shiga cikin apache. A wannan yanayin babban fayil ɗin da ake kira gis.

  • Sa'an nan a ciki, babban fayil ɗin data yana ƙunshe da yadudduka, kothophoto, da dai sauransu.
  • A cikin folda da dai sauransu, akwai nau'ikan rubutu na gaskiya waɗanda aka yi amfani dasu don alamun, tare da .ttf tsawo. Hakanan ga fayil ɗin txt wanda ya ɗaga su da wani wanda ke bayyana alamomin.
  • Kuma a karshe cikin babban fayil httdocs je shafukan intanet wanda ke tayar da sabis ɗin.
  • mai kula da geoserver

Shafin yanar gizo

A cikin misali, zan yi amfani da shari'ar da aka nuna a lokacin ƙarshe. Ainihi ya ƙunshi fayil ɗin fihirisa wanda ke turawa zuwa haɓakar phtml, kuma wannan bi da bi yana haɓaka ayyukan da aka gina a saman php da maps. Babban fayil ya ƙunshi hotunan da aka haɗa daga shafin.

mai kula da geoserver

Idan muka dube shi, phtml kawai harsashi ne wanda aka gina daga tebur, kuma yana kira zuwa ayyukan taswira / php. Ya kamata ku tashi ta amfani da:

http://localhost/gis/gispalenque.phtml

Da ke ƙasa shine sakamakon:

  • zuwa cibiyar aikin GMapDrawMap (),
  • a hannun dama kira zuwa keymap GMapDrawKeyMap (),
  • sikelin da ke ƙasa GMapDrawScaleBar (),
  • kuma idan akwai ayyukan aiki, wani yanayin game da jerin akwatin idan (! IsHtmlMode ()) amsa kuwwa "  tare da yanke shawara: ZOOM_IN, ZOOM_OUT, MAI KARATU, QUERY_POINT.

Tuni ya gudana, abubuwan da suke ciki suna kama da wannan:

mai kula da geoserver

Fayil .map

Haɗuwa da littattafan Taswirar suna cikin abin da Apache yake ɗagawa, wanda ya aika php ta hanyar Taswirar sannan wancan yana fitowa daga wannan harsashi. Amma yawancin kimiyya suna cikin fayilolin .map, kada a rude su da wadanda Mapinfo, Manifold, ko Mobile Mapper Office suka samar tare da kari iri daya.

Waɗannan .map fayilolin rubutu ne, waɗanda suka ƙunshi taswira a cikin tsarin rubutu. Ana iya ƙirƙirar waɗannan ta hanyar shirye-shiryen tebur kamar su Quantum GIS, idan kun lura akwai ɗaya don babban taswirar, ɗaya don Keymap da biyu don ayyukan OGC wms da wfs. Bari mu ga yadda taswira ke aiki:

MAP

NAME PALENQUE_DEMO
STATUS ON
SIZE 600 450
SYMBOLSET ../etc/symbols.txt
XTUM 604299 1933386 610503 1939300 BABI NA KUMA NA PALENQUE
#EXTENT 605786 1935102 608000 1938800 #SOLO DA HANNAN 01
SABARI METERS
SHAPEPATH "../data"
GASKIYA ON
IMAGECOLOR 255 255 255
FONTSET ../etc/fonts.txt

  • MAP ya nuna farawa rubutun
  • STATUS, ya nuna ko yanayin da aka riga ya kasance a kan ko a'a
  • SIZE shine girman girman nuni
  • SYMBOLSET yana nuna hanyar alamun
  • EXTENT sune masu nuni. Ana amfani da alamar # don yin bayani
  • Ƙungiyoyi don raka'a
  • SHAPEPATH, hanyar da yadudduka suke
  • Komai a karshen zai ƙare tare da umurnin END

A ciki, lambar ke farawa tare da layin umarni, kuma ƙare tare da END, misali don ƙananan da iyakar sikelin; shugabancin hotuna na wucin gadi:

WEB
  MINSCALE 2000000
  MANSCALE 50000000

IMAGEPATH "C: \ OSGeo4W / tmp / ms_tmp /"
  IMAGEURL "/ ms_tmp /"
KARSHEN

mai kula da geoserverA sikelin bar:

SCALEBAR
  IMAGECOLOR 255 255 255
  LABEL
    0 0 0 COLOR
    SIZE SMALL
  KARSHEN
  SIZE 300 5
  255 255 255 COLOR
  0 0 0 BACKGROUNDCOLOR
  0 0 0 SANTAWA
  Sassan kilomita
  3 INTERVALS
  STATUS ON
KARSHEN

mai kula da geoserverLayer ɗin raster: wannan yana bayan fage, tare da bayanin a cikin jerin kamar "Orthophoto", daga tiff wanda yake cikin babban fayil ɗin bayanan:

 

 

LAYER
  Sunan tsohuwar
  METADATA
    "Bayyana" "OrtoFoto"
  KARSHEN
  TYPE KASA
  KASHE KASHE
  DATA "C: \ OSGeo4W / apps / gis / data / ortofotoGral.tif"
  #OFFSITE 0 0 0
KARSHEN

Wani shp Layer na polygons, da aka sanya su bisa ka'idodin, ɗauke da wasu bayanai a kan samfurin html, tare da lakabin rubutu, size 6, launi launi da fari na zanen 5 ...

mai kula da geoserver

LAYER
  Sashen NAME02Zone
  TYPE POLYGON
  KASHE KASHE
  50 TRANSPARENCY
  BAYAN 607852 1935706 610804 1938807 METADATA
    "BAYANI" "Jigo daga Darajar Yankin 02"
    "RESULT_FIELDS" "MsLink Cve_Mz Cve_Pred prop Tsawon Yanki KYAU"
  KARSHEN
  DATA PALENQUE_SECTOR01
  TEMPLATE "ttt_query.html"
  TOLERANCE 5
  #TOLERANCEUNITS PIXELS
  LABELITEM "ZUWA"
  CLASSITEM "WANNAN"
  LABELCACHE ON
  CLASS
    1 SYMBOL
    128 128 128 COLOR
    0 0 0 SANTAWA
    NAME "ZoneNULL"
    EXPRESSION ([VALUE] = 0)
    LABEL
         ANGLE AUTO
         0 0 0 COLOR
         FONT sans
         TASHIYAR TSARO
         KASHI Cc
        
BABI NA GASKIYA
         BUFFER 5
         SIZE 6
         200 200 200 SANTAWA
    KARSHEN
  END #class 0 darajar
  CLASS
    3 SYMBOL
    255 128 128 COLOR
    #Color -1 -1 -1 #SIN cika

.... don haka don rufe tare da

KARSHEN
  END #Class Value
END # Layer

Don kammala

Saboda haka, aiki tare da mapserver, kodayake yana da sauki, ya zama mai rikitarwa kuma an iyakance shi ga manyan ayyuka saboda komai yana cikin .map. Babban hasara shine cewa ana yin komai da ƙafa, kamar bayyana kowane launi a cikin jigo, kuma wannan shine dalilin da ya sa kayan aiki irin su CartoWeb suka tashi, wanda ke aiki akan Mapserver amma yana kawo abubuwanda aka gina da misalai tare da halaye waɗanda ke sa wannan fasalin na farko yayi kama da readme farko:

  • Aiki aiki tare, tare da AJAX domin su sake sabunta su
  • Rubuta lambar, muddin rubutun ya sake rubutun .map bisa la'akari da ma'auni
  • Dynamic baya juyawa ba tare da bukatar sabuntawa, kamar dai shi ne wani haske Layer
  • Lissafi na kundin kan layi, an rubuta cache nan da nan
  • Sauke samfurin a cikin samfurin fom
  • Fitarwa zuwa Google Earth
  • Samar da PDF daga abubuwan da ake ciki

A cikin gaba za mu yi duba CartoWeb, a nan zan bar mahada zuwa manyan misalai.

3 Amsoshi ga “Yadda Mapserver yake aiki”

  1. Sannu,

    Ina ƙoƙarin kira wani Layer daga .map, kamar haka:

    LAYER
    Neman test_houses
    TYPE POINT
    GASKIYAR GASKIYA
    GANGAR #
    »

    XXXXX
    KASHE …….
    eess_id
    wkbPoint
    WGS84

    »

    Matsalata ita ce sabis na DSN yana ba da matsala: yayin neman GetCapabilities yana dawo da kalmar sirrin bayanan… zan iya kiran fayil don kauce wa "bayar da" kalmar sirri ko kuwa kuskuren DSN ne ??? Na gode!

  2. Taswirar MapServer wani shiri ne mai mahimmanci wanda aka buƙatar shi don nuna tashoshin sararin samaniya a kan Intanit. Kayan da aka saka shi ne kundin da aka tsara zuwa babban fayil a banza wanda yayi amfani da tsarin fayil na NTFS. Ayyukan sarrafawa kamar yadda sauran masu tafiyarwa suka yi, amma ana sanya su hanyar hanyar motsi maimakon rubutun wasiƙa.

Barin amsa

Your email address ba za a buga.

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.