Today i found this error in ColdFusion 7/Oracle 8
Error Executing Database Query. [Macromedia][Oracle JDBC Driver][Oracle]ORA-00932: inconsistent datatypes: expected NUMBER got DATE
It appeared to be the fact that oracle 8 misunderstands <cfqueryparam cfsqltype="cf_sql_bigint"> as a date.
In this blog you can find some of my findings as an opensource geospatial developer.
Monday, March 17, 2008
Friday, January 18, 2008
oracle import/export dumps
An easy way to port data from one oracle database to another is import/export (bundled with oracle client software). Open a dos-box/shell and type
exp user/pw@tnsname file=export_data.dmp tables=table1,table2,table3
Import the data again with:
imp user/pw@tnsname file=export_data.dmp fromuser=olduser touser=newuser
Remind:
exp user/pw@tnsname file=export_data.dmp tables=table1,table2,table3
Import the data again with:
imp user/pw@tnsname file=export_data.dmp fromuser=olduser touser=newuser
Remind:
- an export made by an user with dba-rights can't be imported by a user without dba-rights. Export the data with a user without dba-rights
- You can check a dump-file on having been exported by a dba-user by opening it in Textpath. On the second line the first character is a U for User or D for DBA.
- an oracle 9 client cannot export data from an oracle 10 database
- If importing geodata from a 9 to a 10 database, use SDO_MIGRATE.TO_CURRENT(tabname,column_name) to convert the geometries.
Friday, January 11, 2008
optimize mapserver performance
There are several ways to improve UMN-mapserver performance. These are a couple of them:
- Take care that mapserver only draws features which are visible and readable by setting proper scale-ranges for layers. If you have mapserver draw 1000s of features leaving you with a chaotic map which is onreadable, think again.
- For shapedata use the mapserver tool shptree to create a tree index for larger shapes. Mapserver uses the index to find the proper features to draw. The index is saved in shape.qix file. http://mapserver.gis.umn.edu/docs/reference/utilityreference/shptree. Very usefull is this batch file which indexes all shapes in a directory at once (save as xxx.bat and place in shape directory)
@ECHO OFF
set shptree=""
IF EXIST C:\ms4w\tools\mapserv\shptree.exe (
set shptree=C:\ms4w\tools\mapserv\shptree.exe
)
IF %shptree%=="" (
ECHO shptree.exe is missing.
GOTO:EOF
) ELSE (
GOTO loopDir
)
:loopDir
FOR /R %%A in (*.shp) do CALL :Subroutine %%A
GOTO:EOF
:Subroutine
ECHO Index: %1
%shptree% %1
GOTO:EOF
- For a set of rasters use gdaltindex (bundled with gdal/ms4w) to index the rasters into a single shape file.
- If you have a set of comparable shapes (like shapes per city in a district). Combine them into one layer using a tileindex (tile4ms tool). http://mapserver.gis.umn.edu/docs/reference/utilityreference/tile4ms. Tile4ms uses an input file with all the shape titles to combine. This input file can be generated with a dos-command
dir /b /s *.shp > metafile.txt
If you have a very large shape, it's sometimes faster to cut the shape in parts and combine the parts using tile4ms. Imaptools has created a tool, shp2tile, which can automatically slice a big shape into a set of tiles. Shp2tile as windows binary is included in ms4w.
- Take care that mapserver only draws features which are visible and readable by setting proper scale-ranges for layers. If you have mapserver draw 1000s of features leaving you with a chaotic map which is onreadable, think again.
- For shapedata use the mapserver tool shptree to create a tree index for larger shapes. Mapserver uses the index to find the proper features to draw. The index is saved in shape.qix file. http://mapserver.gis.umn.edu/docs/reference/utilityreference/shptree. Very usefull is this batch file which indexes all shapes in a directory at once (save as xxx.bat and place in shape directory)
@ECHO OFF
set shptree=""
IF EXIST C:\ms4w\tools\mapserv\shptree.exe (
set shptree=C:\ms4w\tools\mapserv\shptree.exe
)
IF %shptree%=="" (
ECHO shptree.exe is missing.
GOTO:EOF
) ELSE (
GOTO loopDir
)
:loopDir
FOR /R %%A in (*.shp) do CALL :Subroutine %%A
GOTO:EOF
:Subroutine
ECHO Index: %1
%shptree% %1
GOTO:EOF
- For a set of rasters use gdaltindex (bundled with gdal/ms4w) to index the rasters into a single shape file.
- If you have a set of comparable shapes (like shapes per city in a district). Combine them into one layer using a tileindex (tile4ms tool). http://mapserver.gis.umn.edu/docs/reference/utilityreference/tile4ms. Tile4ms uses an input file with all the shape titles to combine. This input file can be generated with a dos-command
dir /b /s *.shp > metafile.txt
If you ever decide to move the shapes to another location. Remember to update the tileindex-dbf since it contains file references.
If you have a very large shape, it's sometimes faster to cut the shape in parts and combine the parts using tile4ms. Imaptools has created a tool, shp2tile, which can automatically slice a big shape into a set of tiles. Shp2tile as windows binary is included in ms4w.
Thursday, December 20, 2007
UMN Mapserver development tools
Here are some interesting tools to improve your mapfile coding work:
- http://www.mediamaps.ch/download/MapFileSyntaxColoration.zip for mapfile syntax highlighting in Eclipse
- http://arcscripts.esri.com/details.asp?dbid=12766 is a plugin for ArcMap
to convert a set of configured layers (mxd) to a mapfile (or axl)
- See all utilities at http://mapserver.gis.umn.edu/docs/link
- http://www.mediamaps.ch/download/MapFileSyntaxColoration.zip for mapfile syntax highlighting in Eclipse
- http://arcscripts.esri.com/details.asp?dbid=12766 is a plugin for ArcMap
to convert a set of configured layers (mxd) to a mapfile (or axl)
- See all utilities at http://mapserver.gis.umn.edu/docs/link
Wednesday, September 19, 2007
ColdFusion password reset
Can't enter your ColdFusion administrator anymore, because your brain has a blank where the CF administrator password should be? Try this:
Log into your server with ssh as 'root'
Edit the file /opt/coldfusionmx7/lib/password.properties with your favorite text editor, something like this should work:
vi /opt/coldfusionmx7/lib/password.properties
The contents of this file look something like this:
#Wed Mar 30 14:44:26 PST 2005
rdspassword='(5_K42"O"
npassword='#<,(F-# Q
nencrypted=true
Put your new password after the = signs in the rdspassword= and password= lines, erasing everything after.
Change the encrypted=true line to encrypted=false and save this file A fully modified file might look like this:
#Wed Mar 30 14:44:26 PST 2005
rdspassword=my_new_password
password=my_new_password
encrypted=false
Restart coldfusionmx like this:
/etc/init.d/coldfusionmx restart
this may take up to a few minutes.
Log into your server with ssh as 'root'
Edit the file /opt/coldfusionmx7/lib/password.properties with your favorite text editor, something like this should work:
vi /opt/coldfusionmx7/lib/password.properties
The contents of this file look something like this:
#Wed Mar 30 14:44:26 PST 2005
rdspassword='(5_K42"O"
npassword='#<,(F-# Q
nencrypted=true
Put your new password after the = signs in the rdspassword= and password= lines, erasing everything after.
Change the encrypted=true line to encrypted=false and save this file A fully modified file might look like this:
#Wed Mar 30 14:44:26 PST 2005
rdspassword=my_new_password
password=my_new_password
encrypted=false
Restart coldfusionmx like this:
/etc/init.d/coldfusionmx restart
this may take up to a few minutes.
Subscribe to:
Posts (Atom)