<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>http://dh.aks.ac.kr/~mokpo/wiki/index.php?action=history&amp;feed=atom&amp;title=Photo_Archive_Management</id>
	<title>Photo Archive Management - 편집 역사</title>
	<link rel="self" type="application/atom+xml" href="http://dh.aks.ac.kr/~mokpo/wiki/index.php?action=history&amp;feed=atom&amp;title=Photo_Archive_Management"/>
	<link rel="alternate" type="text/html" href="http://dh.aks.ac.kr/~mokpo/wiki/index.php?title=Photo_Archive_Management&amp;action=history"/>
	<updated>2026-04-11T12:41:25Z</updated>
	<subtitle>이 문서의 편집 역사</subtitle>
	<generator>MediaWiki 1.31.7</generator>
	<entry>
		<id>http://dh.aks.ac.kr/~mokpo/wiki/index.php?title=Photo_Archive_Management&amp;diff=2286&amp;oldid=prev</id>
		<title>Juhae: /* Check the Data Validity */</title>
		<link rel="alternate" type="text/html" href="http://dh.aks.ac.kr/~mokpo/wiki/index.php?title=Photo_Archive_Management&amp;diff=2286&amp;oldid=prev"/>
		<updated>2021-01-06T08:28:38Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Check the Data Validity&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ko&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 이전 판&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2021년 1월 6일 (수) 08:28 판&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l122&quot; &gt;122번째 줄:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;122번째 줄:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;group by id &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;group by id &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;order by count(*) desc&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;order by count(*) desc&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/* 중복 사진 삭제 * /&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;delete photometa&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;where id in('DJI_0451', 'DJI_0374-Pano', '_HUH7623')&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/* 사진 설명 유무 검사 */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/* 사진 설명 유무 검사 */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Juhae</name></author>
		
	</entry>
	<entry>
		<id>http://dh.aks.ac.kr/~mokpo/wiki/index.php?title=Photo_Archive_Management&amp;diff=2285&amp;oldid=prev</id>
		<title>Admin: 새 문서: ==Create Photo Archive Database Shell==  ===Bulkload Data Repository=== &lt;pre&gt; create table photoBulkload (  	section nvarchar(40) NULL,  	xmltxt XML ); &lt;/pre&gt;  ===Metadata XML Reposit...</title>
		<link rel="alternate" type="text/html" href="http://dh.aks.ac.kr/~mokpo/wiki/index.php?title=Photo_Archive_Management&amp;diff=2285&amp;oldid=prev"/>
		<updated>2021-01-06T04:07:41Z</updated>

		<summary type="html">&lt;p&gt;새 문서: ==Create Photo Archive Database Shell==  ===Bulkload Data Repository=== &amp;lt;pre&amp;gt; create table photoBulkload (  	section nvarchar(40) NULL,  	xmltxt XML ); &amp;lt;/pre&amp;gt;  ===Metadata XML Reposit...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;새 문서&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Create Photo Archive Database Shell==&lt;br /&gt;
&lt;br /&gt;
===Bulkload Data Repository===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
create table photoBulkload ( &lt;br /&gt;
	section nvarchar(40) NULL, &lt;br /&gt;
	xmltxt XML );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Metadata XML Repository===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
create table photoXml (&lt;br /&gt;
	id nvarchar(40) NULL, &lt;br /&gt;
	section nvarchar(40) NULL, &lt;br /&gt;
	xmltxt XML )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Metadata View===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
create view photoMeta as&lt;br /&gt;
select id, section,&lt;br /&gt;
	xmltxt.value('(/Photo/FileName)[1]', 'nvarchar(40)') as FileName,&lt;br /&gt;
	xmltxt.value('(/Photo/PixelWidth)[1]', 'nvarchar(40)') as PixelWidth,&lt;br /&gt;
	xmltxt.value('(/Photo/PixelHeight)[1]', 'nvarchar(40)') as PixelHeight,&lt;br /&gt;
	xmltxt.value('(/Photo/DateTimeOriginal)[1]', 'nvarchar(40)') as DateTimeOriginal,&lt;br /&gt;
	xmltxt.value('(/Photo/Description)[1]', 'nvarchar(40)') as Description,&lt;br /&gt;
	xmltxt.value('(/Photo/Latitude)[1]', 'nvarchar(40)') as Latitude,&lt;br /&gt;
	xmltxt.value('(/Photo/Longitude)[1]', 'nvarchar(40)') as Longitude,&lt;br /&gt;
	xmltxt.value('(/Photo/ObjectName)[1]', 'nvarchar(40)') as ObjectName,&lt;br /&gt;
	xmltxt.value('(/Photo/Keywords)[1]', 'nvarchar(40)') as Keywords&lt;br /&gt;
from photoXml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Metadata Table===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
create table photoData (&lt;br /&gt;
	id nvarchar(40) not NULL,&lt;br /&gt;
	class nvarchar(40) NULL,&lt;br /&gt;
	groupName nvarchar(40) NULL,&lt;br /&gt;
	partName nvarchar(40) NULL,&lt;br /&gt;
	label nvarchar(160 ) NULL,&lt;br /&gt;
	objectName nvarchar(80) NULL,&lt;br /&gt;
	description nvarchar(80) NULL,&lt;br /&gt;
	infoUrl nvarchar(256) NULL,&lt;br /&gt;
	iconUrl nvarchar(256) NULL,&lt;br /&gt;
	note nvarchar(256) NULL,&lt;br /&gt;
	latitude nvarchar(40) NULL,&lt;br /&gt;
	longitude nvarchar(40) NULL,&lt;br /&gt;
	remark nvarchar(256) NULL,&lt;br /&gt;
	primary key (id)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==XML File Bulkload==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
use mokpo&lt;br /&gt;
&lt;br /&gt;
/* 기입력 데이터 확인 */&lt;br /&gt;
select * from photoBulkload&lt;br /&gt;
&lt;br /&gt;
/* 기존 데이터를 모두 삭제하고 새로 반입하려 할 때 */&lt;br /&gt;
delete photoBulkload&lt;br /&gt;
&lt;br /&gt;
/* 특정 지역 데이터만 삭제하고 새로 반입하려 할 때 */&lt;br /&gt;
delete photoBulkload where section='bogwang'&lt;br /&gt;
&lt;br /&gt;
/* 특정 지역 데이터 반입(Import) */&lt;br /&gt;
insert into photoBulkload ( section, xmltxt )&lt;br /&gt;
select 'bogwang', x.* from OPENROWSET(  &lt;br /&gt;
   BULK 'e:\inetpub\wwwroot\data\Mokpo\bogwang\Export_CSV.xml',&lt;br /&gt;
   SINGLE_BLOB) as x;&lt;br /&gt;
&lt;br /&gt;
select * from photoBulkload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Generate Individual Metadata==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 기입력 데이터 확인 */&lt;br /&gt;
select * from photoXml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rebuild===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 기존 데이터를 모두 삭제하고 새로 생성하려 할 때 */&lt;br /&gt;
&lt;br /&gt;
/* 전체 메타데이터 새로 생성 */&lt;br /&gt;
delete photoXml&lt;br /&gt;
&lt;br /&gt;
insert into photoXml(section, xmltxt)&lt;br /&gt;
select section, node.query('.') as xmltxt&lt;br /&gt;
from  photoBulkload CROSS APPLY xmltxt.nodes('/Album/Photo') as R(node) &lt;br /&gt;
&lt;br /&gt;
update photoXml&lt;br /&gt;
set id=replace(xmltxt.value('(/Photo/FileName)[1]', 'nvarchar(40)'), '.jpg', '')&lt;br /&gt;
&lt;br /&gt;
select * from photoXml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Partial Update===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 특정 지역 데이터만 삭제하고 새로 반입하려 할 때 */&lt;br /&gt;
delete photoXml where section='bogwang'&lt;br /&gt;
&lt;br /&gt;
insert into photoXml(section, xmltxt)&lt;br /&gt;
select section, node.query('.') as xmltxt&lt;br /&gt;
from  photoBulkload CROSS APPLY xmltxt.nodes('/Album/Photo') as R(node) &lt;br /&gt;
where section='bogwang'&lt;br /&gt;
&lt;br /&gt;
update photoXml&lt;br /&gt;
set id=replace(xmltxt.value('(/Photo/FileName)[1]', 'nvarchar(40)'), '.jpg', '')&lt;br /&gt;
where section='bogwang'&lt;br /&gt;
&lt;br /&gt;
select * from photoXml where section='bogwang'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Create Relational Table==&lt;br /&gt;
&lt;br /&gt;
===Check the Data Validity===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 중복 id 검사 */&lt;br /&gt;
select id, count(*) as occurence from photoMeta&lt;br /&gt;
group by id &lt;br /&gt;
order by count(*) desc&lt;br /&gt;
&lt;br /&gt;
/* 사진 설명 유무 검사 */&lt;br /&gt;
select ObjectName, Description from photoMeta&lt;br /&gt;
order by len(ObjectName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Create Online Service Data ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 온라인 서비스 데이터 일괄 생성 */&lt;br /&gt;
use mokpo&lt;br /&gt;
delete photoData&lt;br /&gt;
&lt;br /&gt;
insert into photoData&lt;br /&gt;
select &lt;br /&gt;
id, 'HUH_Photo' as class, section grupName, NULL as partName, NULL as label,&lt;br /&gt;
ObjectName,&lt;br /&gt;
Description,&lt;br /&gt;
'http://dh.aks.ac.kr/~mokpo/photo/gallery/'+section+'/'+FileName as infoUrl,&lt;br /&gt;
'http://dh.aks.ac.kr/~mokpo/photo/gallery/'+section+'/thumb/'+FileName as iconUrl,&lt;br /&gt;
Keywords as note,&lt;br /&gt;
Latitude,&lt;br /&gt;
Longitude,&lt;br /&gt;
DateTimeOriginal as remark&lt;br /&gt;
from photoMeta&lt;br /&gt;
&lt;br /&gt;
update photoData&lt;br /&gt;
set label=objectName+' - '+description&lt;br /&gt;
where description is not NULL&lt;br /&gt;
&lt;br /&gt;
update photoData&lt;br /&gt;
set label=objectName&lt;br /&gt;
where description is NULL&lt;br /&gt;
&lt;br /&gt;
select * from photoData&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Find the Center of Region==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 지역 중심 위치 좌표 찾기: wiki 용 */&lt;br /&gt;
&lt;br /&gt;
use mokpo&lt;br /&gt;
create procedure getCenter( @region nvarchar(40) ) &lt;br /&gt;
as   &lt;br /&gt;
begin&lt;br /&gt;
select  @region as 지역,&lt;br /&gt;
	avg(convert(float, latitude)) as 중심_위도, &lt;br /&gt;
	avg(convert(float, longitude))as 중심_경도&lt;br /&gt;
from photoData where groupName=@region&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
exec getCenter bukgyo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[분류:튜토리얼]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
</feed>