ThinkGeo.com    |     Documentation    |     Premium Support

Problem with postgis layer

Hello


I'm using the desktop edition 3.0 to load a postgis layer and i'm geting this error:



This method will return too many cells that might cause performance problem. Please use GetIntersectingGrid method instead.


the code is:

        Dim postgis_layer As New PostgreSqlFeatureLayer
        Dim connectString As String = "Server=128.10.10.135;User Id=postgres;Password=****;DataBase=GIS_TEST;"
        postgis_layer = New PostgreSqlFeatureLayer(connectString, "tr3992ba_p", "gid")
        postgis_layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Urban2
        postgis_layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = 20
        postgis_layer.Open()
        Dim static_overlay As New LayerOverlay
        static_overlay.Layers.Add(postgis_layer)
        map.Overlays.Add(static_overlay)

        map.CurrentExtent = postgis_layer.GetBoundingBox 
        map.Refresh()


I have never had this problem with previous version.


Thx



Gerion,


 Thanks for your post and welcome you to ThinkGeo MapSuite Forum!
 
I think you did not set the correct MapUnit, try to set the Unit to Meter or feet which depends on the data unit.

winformsMap1.MapUnit = GeographyUnit.Meter

Any more questions just let me know.


 
Thanks.
 
Yale

Thank you Yale, it's working now.


Just one more question, when I try to use this


  map.CurrentExtent = postgis_layer.GetBoundingBox


it gives me this error:


function st_extent(geometry) does not exist


I'm importing the npgsql and postgreExtension that are installed by map suite.


Thx again.


 


 



Gerion,


 Thanks for your post!
 
I think it seems there is some functionalities missed in your Postgre server, just like the st_extent function. 
 
Can you try to confirm the function ST_EXTENT in your postgre server works well?Also can you check what version you are trying to use?
 

string versionString = WinformsMap.GetVersion();

 

Any more questions just let me know.
 
Thanks.
 
Yale