Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapscript php v6.0.2 : Projection ORTHO error at the change of scale #4483

Closed
r0123r opened this issue Oct 2, 2012 · 7 comments
Closed

Mapscript php v6.0.2 : Projection ORTHO error at the change of scale #4483

r0123r opened this issue Oct 2, 2012 · 7 comments

Comments

@r0123r
Copy link

r0123r commented Oct 2, 2012

pMapper: world map, countries disappear at the change of scale

success at scale 1:75000000
http://kopexphp.ru/pmapper1.jpg

error at scale 1:59000000
http://kopexphp.ru/pmapper2.jpg

EXTENT -65000000 -65000000 65000000 65000000

archive http://kopexphp.ru/htdocs.rar
Included:
pMapper 4.2

  • country.shp (world)
  • pmapper_demo.map + projection ortho
@tbonfort
Copy link
Member

tbonfort commented Oct 2, 2012

seems like over the horizon reprojection is failing... can you provide the extent and image size of the failing request so I can reproduce this outside of pmapper. thanks

@r0123r
Copy link
Author

r0123r commented Oct 2, 2012

all options in map file (http://kopexphp.ru/pmapper-demo.map):

MAP
EXTENT -65000000 -65000000 65000000 65000000

UNITS meters
SIZE 600 500
SHAPEPATH "../../../pmapper_demodata"
SYMBOLSET "../common/symbols/symbols-pmapper.sym"
FONTSET "../common/fonts/msfontset.txt"
RESOLUTION 96
IMAGETYPE png
INTERLACE OFF

PROJECTION
"proj=ortho"
"units=m"
"ellps=WGS84"
"lat_0=0"
"lon_0=60"
END # PROJECTION

LAYER
DATA "country"
METADATA
"LAYER_ENCODING" "KOI8-R"
"DESCRIPTION" "Country"
"RESULT_FIELDS" "RUS_NAME"
"RESULT_HEADERS" "Name"
END # METADATA
NAME "country"
PROJECTION
"proj=latlong"
"ellps=WGS84"
"datum=WGS84"
END # PROJECTION
STATUS DEFAULT
TILEITEM "location"
OPACITY 30
TYPE POLYGON
UNITS METERS
CLASS
STYLE
ANGLE 0
COLOR 200 254 199
OFFSET 0 0
OUTLINECOLOR 0 0 0
END # STYLE
TEMPLATE "void"
END # CLASS
END # LAYER

END #Map

@r0123r r0123r closed this as completed Oct 2, 2012
@r0123r r0123r reopened this Oct 2, 2012
@tbonfort
Copy link
Member

tbonfort commented Oct 3, 2012

I was able to run your testcase, I need the extents sent by your client which reproduce your issue. you can probably get those by sniffing the requests sent by your browser when an incorrect image appeared.

@r0123r
Copy link
Author

r0123r commented Oct 5, 2012

Post param (in json)

{
sessionerror: false,
mapURL:"/tmp/ol6kmfho1dtpkv7gg89fei57i11349419221042187700.png",
scalebarURL: "/tmp/ol6kmfho1dtpkv7gg89fei57i11349419221049984300.png",
geo_scale: 59000000,
refBoxStr: "0,0,199,149",
refreshToc: "0",
refreshLegend: "1",
mapW: "1395",
mapH: "827",
refW: "199",
refH: "149",
minx_geo: "-11198631.15851",
maxy_geo: "6765118.4544737",
xdelta_geo: "21760909.082442",
ydelta_geo: "12894197.2038",
}

PHP

 
   protected function pmap_zoomscale($scale)
    {
        $x_pix = $this->mapwidth/2;
        $y_pix = $this->mapheight/2;
        $xy_pix = ms_newPointObj();
        $xy_pix->setXY($x_pix, $y_pix);
        $this->map->zoomscale($scale, $xy_pix, $this->mapwidth, $this->mapheight, $this->geoext0, $this->maxextent);
        PMCommon::freeMsObj($xy_pix);
    }
variable:
$this->geoext0 = ms_newrectObj();
$this->geoext0->setextent($this->GEOEXT["minx"],$this->GEOEXT["miny"],$this->GEOEXT["maxx"],$this->GEOEXT["maxy"]);
$this
: object(PMap) = 
  map: object(mapObj) = 
  xdelta_geo: undefined = NULL
  ydelta_geo: undefined = NULL
  geo_scale: undefined = NULL
  old_geo_scale: double = 65000000
  geoext0: object(rectObj) = 
  GEOEXT: array = 
    minx: string = "-12328913.478265"
    miny: string = "-6760932.2019588"
    maxx: string = "11644969.409172"
    maxy: string = "7444539.2937533"
  mapwidth: long = 1395
  mapheight: long = 827
  refW: undefined = NULL
  refH: undefined = NULL
  refBoxStr: undefined = NULL
  historyBack: undefined = NULL
  historyFwd: undefined = NULL
  msVersion: double = 6.02
  groups: array = 
    0: string = "cities10000eu"
  activeGroups: array = 
    0: object(GROUP) = 
      groupName: string = "cities10000eu"
      description: string = "Cities"
      layerList: array = 
        0: object(GLAYER) = 
          glayerIdx: long = 3
          glayerType: long = 0
          selFields: array = 
            0: string = "NAME"
            1: string = "ISO2_CODE"
            2: string = "POPULATION"
            3: string = "GTOPO30"
          hyperFields: array = 
            0: array = 
              0: string = "NAME"
            1: array = 
          joinList: undefined = NULL
          classes: array = 
            0: string = "> 1'000'000"
            1: string = "500'000 - 1'000'000"
            2: string = "100'000 - 500'000"
            3: string = "50'000 - 100'000"
            4: string = "10'000 - 50'000"
          labelItem: string = "NAME"
          isXYLayer: bool = FALSE
          XYLayerProperties: undefined = NULL
          skipLegend: bool = FALSE
          glayerName: string = "cities10000eu"
          glayerOpacity: long = 100
          layerEncoding: string = "UTF-8"
          layerDbProperties: undefined = NULL
      selHeaders: array = 
        0: string = "Name"
        1: string = "Country"
        2: string = "Inhabitants"
        3: string = "Altitude"
      selStdHeaders: array = 
        0: string = "Name"
        1: string = "Country"
        2: string = "Inhabitants"
        3: string = "Altitude"
  zoom_factor: string = "1"

@tbonfort
Copy link
Member

tbonfort commented Oct 5, 2012

well, your countries shapefile only contains european countries, and mapserver can't invent the others :)
Try changing DATA countries to DATA country
This is the command I'm running:

shp2img -m pmapper_demo.map -o tt.png -s 1395 827 -e -12328913.478265 -6760932.2019588 11644969.409172 7444539.2937533

@r0123r
Copy link
Author

r0123r commented Oct 5, 2012

country.shp I collected myself with postgis, it contains the nations of the world
files in archive http://kopexphp.ru/htdocs.rar
screenshot: http://kopexphp.ru/pmapper1.jpg
in mapscript_php v5.6 this is no error

PS: continent.shp (all continents) - error does not cause

@mapserver-bot
Copy link

This is an automated comment

This issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen with missing/relevant information if still valid.

Typically, issues fall in this state for one of the following reasons:

  • Hard, impossible or not enough information to reproduce
  • Missing test case
  • Lack of a champion with interest and/or funding to address the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants