|
The problem is that TileRenderWindow function accepts projected coordinates(?),
That's explicitly covered in the documentation on TileRender in the Tile SQL Functions topic. Start by reviewing that. Note the advice to use the Edit Query button in the Edit - Save as Image command to get examples of how to use such functions. For example, using a satellite image and zooming into the Louvre and then using the Edit Query in the Save as Image command, you can see something like... CREATE TABLE [Bing Maps Satellite Image Image Table] ( [mfd_id] INT64, [X] INT32, [Y] INT32, [Tile] TILE, INDEX [mfd_id_x] BTREE ([mfd_id]), INDEX [X_Y_Tile_x] RTREE ([X], [Y], [Tile] TILESIZE (128, 128) TILETYPE UINT8X4), PROPERTY 'FieldCoordSystem.Tile' '{ "Axes": "XYH", "Base": "WGS 84 (EPSG:4326)", "CenterLat": 0, "CenterLon": 0, "Eccentricity": 0.08181919084262149, "LocalOffsetX": 259446.75105703622, "LocalOffsetY": 6251151.822671514, "LocalScaleX": 0.8301225112979417, "LocalScaleY": 0.8301225112977758, "MajorAxis": 6378137, "Name": "WGS 84 \/ Pseudo-Mercator (EPSG:3857)", "System": "Pseudo Mercator", "Unit": "Meter", "UnitScale": 1, "UnitShort": "m" }', PROPERTY 'FieldTileSize.Tile' '[ 128, 128 ]', PROPERTY 'FieldTileType.Tile' 'uint8x4' ); CREATE IMAGE [Bing Maps Satellite Image Image] ( PROPERTY 'Table' '[Bing Maps Satellite Image Image Table]', PROPERTY 'FieldTile' 'Tile', PROPERTY 'FieldX' 'X', PROPERTY 'FieldY' 'Y', PROPERTY 'Rect' '[ 0, 0, 1084, 594 ]' ); INSERT INTO [Bing Maps Satellite Image Image Table] ([X], [Y], [Tile]) SELECT [X], [Y], [Tile] FROM CALL TileRenderWindow('Bing Maps Satellite Image', VectorMakeX4(67977793.23182209, 88044984.91555186, 67980806.9847445, 88046636.36318646), VectorMakeX2(1084, 594), VectorMakeX2(128, 128), 96, false); TABLE CALL TileUpdatePyramids([Bing Maps Satellite Image Image]); Note the use of pseudo-mercator coordinates. GeomBoundsRect (see the documentation) returns an x4 value that is the x,y locations of the diagonally opposite corners of the rect in the coordinate system of the geom. It's not clear what you intend to do, but I get the impression that you have a map with two layers, a drawing layer (remember, once you import from a shapefile it is a drawing that has no connection to any shapefile) and some raster image layer. For each object in the drawing, you want to find the bounding rectangle and then create a raster image that covers that bounding rectangle using the raster layer. Is that it? If so, just use the same projection for the raster layer (likely pseudo mercator), the drawing layer and the map. Keep it simple. If the source shapefile was in some other projection so the drawing that was imported is in some other projection, reproject it into the same projection as the map and raster layer. You can then use the same coordinates throughout with no need to convert any using coordinate converter objects, etc.
|