Hi Uwe,

I made two improvements to try to solve the extent calculation problem
(see r3439).

Note : I don't know if you still have the WKB 0 bug.

Add a "VACUMM ANALYZE theNewTable" after creation of a new table
why ?
It seems that the index creation is not enough to use ST_Estimated_Extent
just after the table creation

Test if the geometry column we want to use is indexed with a spatial index
to determine if ST_Estimated_Extent or ST_Extent must be used.
(it was quite difficult to know if a column is spatially indexed).

Please try extensively,

Michaël
> Hi,
>
> OK, I see,
> There are 2 methods to get the envelope in the code :
>
> ST_Estimated_Extent (fast, not precise, based on index)
> ST_Extent (slow, precise)
>
> Currently, we switch on second method if first one throws an exception
> (don't know in which circumstances exactly)
>
> I can see if I can add a test on spatial index existence and switch
> also to second method if there is no spatial index.
>
> Michaël
>
>> Hi Jukka,
>>
>> Bingo!!!
>> That was the 100 000 000,- euro idea!
>>
>> create index on t_line_invis using gist ( geom );
>>
>> Now I see the geometries in openjump.
>>
>> But I see a problem with small tables creating
>> without indices.
>> What can we do with this?
>>
>> Uwe
>>
>>
>> Am 28.03.2013 08:25, schrieb Rahkonen Jukka:
>>> Hi Uwe,
>>>
>>> Try to add spatial index to your test tables and see what happens then.  
>>> OpenJUMP is doing query as
>>> SELECT ST_AsBinary(ST_Estimated_Extent)
>>> It is fast and I think the right way to do it in OpenJUMP but I do not 
>>> believe that it can work work without spatial index.
>>> http://postgis.refractions.net/documentation/manual-1.4/ST_Estimated_Extent.html
>>>
>>> -Jukka-
>>>
>>>
>>> ________________________________________
>>> Lähettäjä: Uwe Dalluege [uwe.dallu...@hcu-hamburg.de]
>>> Lähetetty: 28. maaliskuuta 2013 8:29
>>> Vastaanottaja: OpenJump develop and use
>>> Cc: Michaël Michaud
>>> Aihe: Re: [JPP-Devel] Unknown WKB type 0 and change coord_dimension
>>>
>>> Hi Michaël,
>>>
>>> I see it is not so easy to find this bug.
>>> I will make some other tests and let you know.
>>>
>>> But have you tried my test I have posted at 26.03.2013
>>> (PostGIS Layer invisible; Zoom To Full Extent)?
>>>
>>> ...
>>>
>>> I have a problem with Zoom To Full Extent
>>> with the new PostGIS reader!
>>> Using PostgreSQL 9.2.1 with PostGIS 2.0.
>>>
>>> I created two tables with SQL.
>>>
>>> This table (t_line) works fine:
>>>
>>> drop table if exists t_line;
>>> CREATE TABLE t_line ( lnr integer, geom geometry ( LINESTRING, 0 ) );
>>> INSERT INTO t_line VALUES
>>>       ( 1, ST_GeometryFromText ( 'LINESTRING ( 200.0 200.0, 250.0 230.0,
>>> 210.0 250.0 )', 0 ) );
>>> INSERT INTO t_line VALUES
>>>       ( 2, ST_GeometryFromText ( 'LINESTRING ( 100.0 100.0, 150.0 130.0,
>>> 110.0 150.0 )', 0 ) );
>>>
>>> SELECT * FROM t_line;
>>>
>>>
>>> This table (t_line_invis) is invisible after Zoom To Full Extent:
>>>
>>> drop table if exists t_line_invis;
>>> CREATE TABLE t_line_invis ( lnr integer, geom geometry ( LINESTRING, 0 ) );
>>> INSERT INTO t_line_invis VALUES
>>>       ( 1, ST_GeometryFromText ( 'LINESTRING ( 2000.0 2000.0, 2500.0 2300.0,
>>> 2100.0 2500.0 )', 0 ) );
>>> INSERT INTO t_line_invis VALUES
>>>       ( 2, ST_GeometryFromText ( 'LINESTRING ( 1000.0 1000.0, 1500.0 1300.0,
>>> 1100.0 1500.0 )', 0 ) );
>>>
>>> SELECT * FROM t_line_invis;
>>> ...
>>>
>>> Uwe
>>>
>>> Am 27.03.2013 19:36, schrieb Michaël Michaud:
>>>> Hi,
>>>>
>>>> I can't see the "WKB type 0" problem in the above sequence.
>>>> Is it solved or is it repeatable with another sequence.
>>>>
>>>>> No, I do not tested it with r3404+
>>>>> but I done the modification inside the source code.
>>>>>
>>>>> Now I test r3412.
>>>>> Do you made the modification in r3412?
>>>>>
>>>>> I see that the coord_dimension has changed from 2 to 3:
>>>>>
>>>>>
>>>>> 1. I open my project GeoCity with a .jml layer
>>>>> Wohngebiet.
>>>> Did you change the dataset ? (I used Gebaeudeprivat instead)
>>>>> 2. Saving this jml-layer to PostGIS.
>>>>> 3. Close OpenJUMP (important)!
>>>>> 4. Start OJ again and open the table Wohngebiet
>>>>> in PostGIS
>>>>> 5. No Such Element Exception
>>>>> and I see no geometries
>>>> I could not reproduce this today, but I have seen that before.
>>>> I have already tried to find a solution but it's a bit tricky.
>>>> I think we will have to live with it some time...
>>>>> 6. "Zoom To Full Extent" and I see the geometries.
>>>> As I told you, full extent of a database layer can contains too
>>>> many features for OpenJUMP, and I think it is more safe not
>>>> to do it automatically after the first import. If it is not down,
>>>> the layer may be empty (probably related to the No such
>>>> element exception though)
>>>>> 7. Now I load the table again and there is no more
>>>>> the error "No Such Element Exception".
>>>> And after the first "Zoom to extent", the driver extracts data
>>>> in a zone where there IS data.
>>>>> 8. Close OJ.
>>>>> 9. Start OJ and load the table Wohngebiet.
>>>>> 10. The error "No Such Element Exception" appears.
>>>>> 11. Set srid to 31467 to the layer Wohngebiet.
>>>>> 12. Save the PostGIS layer Wohngebiet under a new name wg31467.
>>>>> 13. The coord_dimension of wg31467 is not 2 but 3!
>>>> According to my tests and to the code the geometry coord dimension
>>>> should be 2, but there may be strange behaviour as the code tests a
>>>> few geometries and if it finds a single z, it save as a GeometryZ, 
>>>> otherwise
>>>> it should save as Geometry.
>>>> Is it possible that you edited a z on a geometry ?
>>>>> 14. Load the table wg31467 and there are no geometries!
>>>>> No errors and no geometries.
>>>> Cannot reproduce that.
>>>> Is it possible that you have moved and that your windows do not
>>>> intersects data anymore ?
>>>>
>>>> Michaël
>>>>> I hope you can reproduce this.
>>>>>
>>>>> Have a nice day
>>>>>
>>>>> Uwe
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Own the Future-Intel® Level Up Game Demo Contest 2013
>>>>> Rise to greatness in Intel's independent game demo contest.
>>>>> Compete for recognition, cash, and the chance to get your game
>>>>> on Steam. $5K grand prize plus 10 genre and skill prizes.
>>>>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>>>>> _______________________________________________
>>>>> Jump-pilot-devel mailing list
>>>>> Jump-pilot-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>>
>>>>>
>>>> ------------------------------------------------------------------------------
>>>> Own the Future-Intel® Level Up Game Demo Contest 2013
>>>> Rise to greatness in Intel's independent game demo contest.
>>>> Compete for recognition, cash, and the chance to get your game
>>>> on Steam. $5K grand prize plus 10 genre and skill prizes.
>>>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>>>> _______________________________________________
>>>> Jump-pilot-devel mailing list
>>>> Jump-pilot-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>>
>>> ------------------------------------------------------------------------------
>>> Own the Future-Intel® Level Up Game Demo Contest 2013
>>> Rise to greatness in Intel's independent game demo contest.
>>> Compete for recognition, cash, and the chance to get your game
>>> on Steam. $5K grand prize plus 10 genre and skill prizes.
>>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> Jump-pilot-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>
>> ------------------------------------------------------------------------------
>> Own the Future-Intel® Level Up Game Demo Contest 2013
>> Rise to greatness in Intel's independent game demo contest.
>> Compete for recognition, cash, and the chance to get your game
>> on Steam. $5K grand prize plus 10 genre and skill prizes.
>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>
>>
>
> ------------------------------------------------------------------------------
> Own the Future-Intel® Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>


------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to